[ADD] res.partner.contract: date_conclusion_fix field, rename date -> date_conclusion
This commit is contained in:
parent
6e26f9f83e
commit
7490044254
@ -10,11 +10,16 @@ class PartnerContract(models.Model):
|
||||
name = fields.Char(
|
||||
string='Contract number',
|
||||
)
|
||||
date = fields.Date(
|
||||
date_conclusion = fields.Date(
|
||||
string='Date of conclusion',
|
||||
default=datetime.date.today(),
|
||||
required=True
|
||||
)
|
||||
date_conclusion_fix = fields.Date(
|
||||
string='Manual Date of conclusion',
|
||||
help='Field for manual edit when contract is signed or closed',
|
||||
default=lambda self: self.date_conclusion,
|
||||
)
|
||||
order_ids = fields.One2many(
|
||||
'sale.order',
|
||||
'contract_id',
|
||||
@ -76,7 +81,7 @@ class PartnerContract(models.Model):
|
||||
date_part = contract_date.strftime('%d%m-%y')
|
||||
|
||||
today_contracts = self.search([
|
||||
('date', '=', contract_date.date()),
|
||||
('date_conclusion', '=', contract_date.date()),
|
||||
])
|
||||
if len(today_contracts) > 0:
|
||||
name = today_contracts[-1].name or '0-0-0'
|
||||
|
@ -8,7 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Contracts">
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="date_conclusion"/>
|
||||
<field name="partner_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
@ -30,7 +30,9 @@
|
||||
<sheet>
|
||||
<group string="Contract parameters" name="single_params">
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="date" attrs="{'readonly': [('state', 'in', ['sign', 'close'])]}"/>
|
||||
<field name="create_date"/>
|
||||
<field name="date_conclusion" attrs="{'readonly': [('state', 'in', ['sign', 'close'])]}"/>
|
||||
<field name="date_conclusion_fix"/>
|
||||
<field name="partner_id" readonly="1"/>
|
||||
</group>
|
||||
<group string="Annexed orders" name="multi_params">
|
||||
|
Loading…
x
Reference in New Issue
Block a user