mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
@@ -1,2 +1,3 @@
|
||||
from . import product_category
|
||||
from . import product_product
|
||||
from . import product_template
|
||||
|
||||
18
product_category_tax/models/product_product.py
Normal file
18
product_category_tax/models/product_product.py
Normal 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)]
|
||||
Reference in New Issue
Block a user