[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(
|
name = fields.Char(
|
||||||
string='Contract number',
|
string='Contract number',
|
||||||
)
|
)
|
||||||
date = fields.Date(
|
date_conclusion = fields.Date(
|
||||||
string='Date of conclusion',
|
string='Date of conclusion',
|
||||||
default=datetime.date.today(),
|
default=datetime.date.today(),
|
||||||
required=True
|
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(
|
order_ids = fields.One2many(
|
||||||
'sale.order',
|
'sale.order',
|
||||||
'contract_id',
|
'contract_id',
|
||||||
@ -76,7 +81,7 @@ class PartnerContract(models.Model):
|
|||||||
date_part = contract_date.strftime('%d%m-%y')
|
date_part = contract_date.strftime('%d%m-%y')
|
||||||
|
|
||||||
today_contracts = self.search([
|
today_contracts = self.search([
|
||||||
('date', '=', contract_date.date()),
|
('date_conclusion', '=', contract_date.date()),
|
||||||
])
|
])
|
||||||
if len(today_contracts) > 0:
|
if len(today_contracts) > 0:
|
||||||
name = today_contracts[-1].name or '0-0-0'
|
name = today_contracts[-1].name or '0-0-0'
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Contracts">
|
<tree string="Contracts">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="date"/>
|
<field name="date_conclusion"/>
|
||||||
<field name="partner_id"/>
|
<field name="partner_id"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@ -30,7 +30,9 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<group string="Contract parameters" name="single_params">
|
<group string="Contract parameters" name="single_params">
|
||||||
<field name="name" readonly="1"/>
|
<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"/>
|
<field name="partner_id" readonly="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Annexed orders" name="multi_params">
|
<group string="Annexed orders" name="multi_params">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user