Revertir cambio: eliminar cálculo duplicado de impuestos
El método _get_price() del addon OCA ya maneja correctamente los impuestos según la configuración de Odoo. El cálculo adicional con compute_all() estaba duplicando los impuestos cuando price_include estaba activado. Cambios: - Eliminado método _compute_price_with_taxes() - Revertido eskaera_shop() para usar directamente _get_price() - Revertido add_to_eskaera_cart() para usar directamente _get_price() El precio mostrado ahora respeta la configuración de impuestos de Odoo sin duplicación.
This commit is contained in:
parent
3cb0af6a7b
commit
4d23e98f7b
30 changed files with 3611 additions and 1004 deletions
31
product_main_seller/models/product_template.py
Normal file
31
product_main_seller/models/product_template.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
|
||||
# @author: Quentin DUPONT (quentin.dupont@grap.coop)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api
|
||||
from odoo import fields
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
main_seller_id = fields.Many2one(
|
||||
comodel_name="res.partner",
|
||||
string="Main Vendor",
|
||||
help="Put your supplier info in first position to set as main vendor",
|
||||
compute="_compute_main_seller_id",
|
||||
store=True,
|
||||
)
|
||||
|
||||
@api.depends("variant_seller_ids.sequence", "variant_seller_ids.partner_id.active")
|
||||
def _compute_main_seller_id(self):
|
||||
for template in self:
|
||||
if template.variant_seller_ids:
|
||||
template.main_seller_id = fields.first(
|
||||
template.variant_seller_ids.filtered(
|
||||
lambda seller: seller.partner_id.active
|
||||
)
|
||||
).partner_id
|
||||
else:
|
||||
template.main_seller_id = False
|
||||
Loading…
Add table
Add a link
Reference in a new issue