Skip to content

Commit

Permalink
Merge 397e936 into c8728ce
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb committed Jan 15, 2018
2 parents c8728ce + 397e936 commit b69ee80
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ def write_taxes_setting(self, vals):
"""If Fiscal Classification is defined, set the according taxes
to the product(s); Otherwise, find the correct Fiscal classification,
depending of the taxes, or create a new one, if no one are found."""
if vals.get('fiscal_classification_id', False):
classification_id = vals.get('fiscal_classification_id', False)
if classification_id:
# update or replace 'taxes_id' and 'supplier_taxes_id'
classification = self.fiscal_classification_id
classification_obj = self.env['account.product.fiscal.classification']
classification = classification_obj.browse(classification_id)
tax_vals = {
'supplier_taxes_id': [[6, 0, [
x.id for x in classification.purchase_tax_ids]]],
Expand Down

0 comments on commit b69ee80

Please sign in to comment.