Use depends on methods
issue5191 review45481002
This commit is contained in:
+1
-8
@@ -40,6 +40,7 @@ class InvoiceLine:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'account.invoice.line'
|
||||
|
||||
@fields.depends('origin')
|
||||
def _get_tax_rule_pattern(self):
|
||||
pool = Pool()
|
||||
SaleLine = pool.get('sale.line')
|
||||
@@ -60,11 +61,3 @@ class InvoiceLine:
|
||||
pattern['from_country'] = from_country.id if from_country else None
|
||||
pattern['to_country'] = to_country.id if to_country else None
|
||||
return pattern
|
||||
|
||||
@fields.depends('origin')
|
||||
def on_change_product(self):
|
||||
super(InvoiceLine, self).on_change_product()
|
||||
|
||||
@fields.depends('origin')
|
||||
def on_change_account(self):
|
||||
super(InvoiceLine, self).on_change_account()
|
||||
|
||||
+2
-5
@@ -25,6 +25,8 @@ class PurchaseLine:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'purchase.line'
|
||||
|
||||
@fields.depends('purchase', '_parent_purchase.warehouse',
|
||||
'_parent_purchase.invoice_address')
|
||||
def _get_tax_rule_pattern(self):
|
||||
pattern = super(PurchaseLine, self)._get_tax_rule_pattern()
|
||||
|
||||
@@ -39,8 +41,3 @@ class PurchaseLine:
|
||||
pattern['from_country'] = from_country.id if from_country else None
|
||||
pattern['to_country'] = to_country.id if to_country else None
|
||||
return pattern
|
||||
|
||||
@fields.depends('_parent_purchase.warehouse',
|
||||
'_parent_purchase.invoice_address')
|
||||
def on_change_product(self):
|
||||
super(PurchaseLine, self).on_change_product()
|
||||
|
||||
@@ -25,6 +25,8 @@ class SaleLine:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'sale.line'
|
||||
|
||||
@fields.depends('sale', '_parent_sale.warehouse',
|
||||
'_parent_sale.shipment_address')
|
||||
def _get_tax_rule_pattern(self):
|
||||
pool = Pool()
|
||||
Location = pool.get('stock.location')
|
||||
@@ -46,7 +48,3 @@ class SaleLine:
|
||||
pattern['from_country'] = from_country.id if from_country else None
|
||||
pattern['to_country'] = to_country.id if to_country else None
|
||||
return pattern
|
||||
|
||||
@fields.depends('_parent_sale.warehouse', '_parent_sale.shipment_address')
|
||||
def on_change_product(self):
|
||||
super(SaleLine, self).on_change_product()
|
||||
|
||||
Reference in New Issue
Block a user