diff --git a/account.py b/account.py index f4316494d2..aca6adc97a 100644 --- a/account.py +++ b/account.py @@ -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() diff --git a/purchase.py b/purchase.py index 4edfd3294c..23c1727a16 100644 --- a/purchase.py +++ b/purchase.py @@ -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() diff --git a/sale.py b/sale.py index 85f91fc204..8081a6c024 100644 --- a/sale.py +++ b/sale.py @@ -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()