Skip to content

Commit

Permalink
shopinvader_sale_configurator_option: fix price computation with pric…
Browse files Browse the repository at this point in the history
…elist without discount
  • Loading branch information
sebastienbeau authored and paradoxxxzero committed Mar 4, 2024
1 parent 8616c05 commit f4e27c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions shopinvader_sale_configurator_option/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import product_product
from . import shopinvader_variant
from . import sale_order_line
from . import product_pricelist
18 changes: 18 additions & 0 deletions shopinvader_sale_configurator_option/models/product_pricelist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class ProductPricelist(models.Model):
_inherit = "product.pricelist"

def get_product_price_rule(
self, product, quantity, partner, date=False, uom_id=False
):
# The following line will convert NewId with origin to normal record
product = self.env["product.product"].browse(product.ids)
return super().get_product_price_rule(
product, quantity, partner, date=date, uom_id=uom_id
)
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ def _compute_shopinvader_price(self):
"record_id": record.id,
}
)
shopinvader_variant.record_id = record
record.shopinvader_price = shopinvader_variant.price

0 comments on commit f4e27c8

Please sign in to comment.