Contract clauses
This commit is contained in:
@@ -859,7 +859,7 @@ class ContractClause(ModelSQL, ModelView):
|
||||
language = fields.Char("Language")
|
||||
source = fields.Char("Source")
|
||||
text = fields.Text("Text", required=True)
|
||||
incoterm = fields.Many2One('incoterm.incoterm', "Incoterm")
|
||||
incoterm_code = fields.Char("Incoterm")
|
||||
product = fields.Many2One('product.product', "Product")
|
||||
payment_term = fields.Many2One(
|
||||
'account.invoice.payment_term', "Payment Term")
|
||||
@@ -893,9 +893,9 @@ class ContractClause(ModelSQL, ModelView):
|
||||
def matches_contract(self, contract, direction):
|
||||
if self.direction not in ('both', direction):
|
||||
return False
|
||||
if (self.incoterm
|
||||
and getattr(getattr(contract, 'incoterm', None), 'id', None)
|
||||
!= self.incoterm.id):
|
||||
if (self.incoterm_code
|
||||
and getattr(getattr(contract, 'incoterm', None), 'code', None)
|
||||
!= self.incoterm_code):
|
||||
return False
|
||||
if (self.payment_term
|
||||
and getattr(getattr(contract, 'payment_term', None), 'id', None)
|
||||
@@ -929,7 +929,7 @@ class ContractTemplate(ModelSQL, ModelView):
|
||||
('sale', 'Sale'),
|
||||
], "Direction", required=True)
|
||||
active = fields.Boolean("Active")
|
||||
incoterm = fields.Many2One('incoterm.incoterm', "Incoterm")
|
||||
incoterm_code = fields.Char("Incoterm")
|
||||
product = fields.Many2One('product.product', "Product")
|
||||
payment_term = fields.Many2One(
|
||||
'account.invoice.payment_term', "Payment Term")
|
||||
@@ -959,9 +959,9 @@ class ContractTemplate(ModelSQL, ModelView):
|
||||
def matches_contract(self, contract, direction):
|
||||
if self.direction not in ('both', direction):
|
||||
return False
|
||||
if (self.incoterm
|
||||
and getattr(getattr(contract, 'incoterm', None), 'id', None)
|
||||
!= self.incoterm.id):
|
||||
if (self.incoterm_code
|
||||
and getattr(getattr(contract, 'incoterm', None), 'code', None)
|
||||
!= self.incoterm_code):
|
||||
return False
|
||||
if (self.payment_term
|
||||
and getattr(getattr(contract, 'payment_term', None), 'id', None)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<label name="source"/>
|
||||
<field name="source"/>
|
||||
<newline/>
|
||||
<label name="incoterm"/>
|
||||
<field name="incoterm"/>
|
||||
<label name="incoterm_code"/>
|
||||
<field name="incoterm_code"/>
|
||||
<label name="product"/>
|
||||
<field name="product"/>
|
||||
<label name="payment_term"/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<field name="name"/>
|
||||
<field name="category"/>
|
||||
<field name="direction"/>
|
||||
<field name="incoterm"/>
|
||||
<field name="incoterm_code"/>
|
||||
<field name="product"/>
|
||||
<field name="payment_term"/>
|
||||
<field name="active"/>
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<label name="active"/>
|
||||
<field name="active"/>
|
||||
<newline/>
|
||||
<label name="incoterm"/>
|
||||
<field name="incoterm"/>
|
||||
<label name="incoterm_code"/>
|
||||
<field name="incoterm_code"/>
|
||||
<label name="product"/>
|
||||
<field name="product"/>
|
||||
<label name="payment_term"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="direction"/>
|
||||
<field name="incoterm"/>
|
||||
<field name="incoterm_code"/>
|
||||
<field name="product"/>
|
||||
<field name="payment_term"/>
|
||||
<field name="active"/>
|
||||
|
||||
Reference in New Issue
Block a user