Merge PR #1414 into 15.0

Signed-off-by AaronHForgeFlow
This commit is contained in:
OCA-git-bot
2022-07-18 10:00:12 +00:00
2 changed files with 19 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
from . import product_category
from . import product_product
from . import product_template

View File

@@ -0,0 +1,18 @@
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, models
class ProductProduct(models.Model):
_inherit = "product.product"
@api.onchange("categ_id")
def onchange_categ_id(self):
if self.categ_id:
self.set_tax_from_category()
def set_tax_from_category(self):
self.ensure_one()
self.taxes_id = [(6, 0, self.categ_id.taxes_id.ids)]
self.supplier_taxes_id = [(6, 0, self.categ_id.supplier_taxes_id.ids)]