Pricing manual

This commit is contained in:
2026-04-10 07:52:59 +02:00
parent 90eab73430
commit b68f475e22
6 changed files with 177 additions and 63 deletions

View File

@@ -1344,20 +1344,9 @@ class SaleLine(metaclass=PoolMeta):
Pricing = Pool().get('pricing.pricing')
pricings = Pricing.search(['price_component','=',pc.id],order=[('pricing_date', 'ASC')])
if pricings:
cumul_qt = Decimal(0)
base_quantity = self._get_pricing_base_quantity()
index = 0
for pr in pricings:
cumul_qt += pr.quantity
pr.fixed_qt = cumul_qt
pr.fixed_qt_price = pr.get_fixed_price()
pr.unfixed_qt = base_quantity - pr.fixed_qt
pr.unfixed_qt_price = pr.fixed_qt_price
pr.eod_price = pr.get_eod_price_sale()
if index == len(pricings) - 1:
pr.last = True
index += 1
Pricing.save([pr])
Pricing._sync_manual_values(pricings)
Pricing._sync_manual_last(pricings)
Pricing._sync_eod_price(pricings)
if pc.triggers and pc.auto:
prDate = []