Compare commits

...

3 Commits

Author SHA1 Message Date
oscar alvarez 22087b4889 Fix 2023-11-27 16:39:14 -05:00
oscar alvarez 5c66b32ca0 Fix 2023-11-27 16:24:06 -05:00
oscar alvarez 2e05b871b3 Fix 2023-11-27 15:47:50 -05:00
3 changed files with 21 additions and 19 deletions

View File

@ -37,15 +37,15 @@ class Prospect(ModelSQL, ModelView):
agent = fields.Many2One('commission.agent', 'Agent')
class Person(ModelSQL, ModelView):
'Person'
__name__ = 'crm.person'
opportunity = fields.Many2One('crm.opportunity', 'Opportunity',
required=True, readonly=True)
name = fields.Char("Name", required=True)
phone = fields.Char('Contact Phone')
email = fields.Char('Email')
id_number = fields.Char('Id Number')
# class Person(ModelSQL, ModelView):
# 'Person'
# __name__ = 'crm.person'
# opportunity = fields.Many2One('crm.opportunity', 'Opportunity',
# required=True, readonly=True)
# name = fields.Char("Name", required=True)
# phone = fields.Char('Contact Phone')
# email = fields.Char('Email')
# id_number = fields.Char('Id Number')
class Opportunity(
@ -196,10 +196,10 @@ class Opportunity(
states={
'invisible': ~Eval('state').in_(['won'])
}, depends=['state'])
persons = fields.One2Many('crm.person', 'opportunity', 'Persons',
states={
'readonly': Eval('state').in_(['won', 'lost']),
})
# persons = fields.One2Many('crm.person', 'opportunity', 'Persons',
# states={
# 'readonly': Eval('state').in_(['won', 'lost']),
# })
@classmethod
def __setup__(cls):
@ -221,10 +221,11 @@ class Opportunity(
cls._buttons.update({
'opportunity': {
'invisible': Eval('state').in_(
['won', 'lost', 'opportunity','cancelled']),
['won', 'lost', 'opportunity', 'cancelled']),
},
'converted': {
'invisible': Eval('state').in_(['lead', 'convert', 'cancelled']),
'invisible': Eval('state').in_(
['lead', 'convert', 'cancelled']),
},
'won': {
'invisible': ~Eval('state').in_(['converted']),
@ -233,7 +234,8 @@ class Opportunity(
'invisible': ~Eval('state').in_(['converted']),
},
'cancelled': {
'invisible': Eval('state').in_(['lead', 'won', 'lost', 'cancelled']),
'invisible': Eval('state').in_([
'lead', 'won', 'lost', 'cancelled']),
},
})
@ -754,7 +756,7 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
@staticmethod
def default_billing_frecuency():
return 'monthly'
return 'one_payment'
@classmethod
def get_opportunity_states(cls):

View File

@ -276,7 +276,7 @@ this repository contains the full copyright notices and license terms. -->
</record>
<record model="ir.action.report" id="report_opportunity">
<field name="name">Quotation Short Format</field>
<field name="name">Quotation</field>
<field name="model">crm.opportunity</field>
<field name="report_name">crm.opportunity</field>
<field name="extension">pdf</field>

View File

@ -1,5 +1,5 @@
[tryton]
version=6.0.18
version=6.0.19
depends:
party
sale