12.03.26
This commit is contained in:
@@ -167,6 +167,7 @@ def register():
|
||||
purchase.DocTemplate,
|
||||
purchase.DocTypeTemplate,
|
||||
purchase.PurchaseStrategy,
|
||||
purchase.PriceComposition,
|
||||
backtoback.Backtoback,
|
||||
dimension.AnalyticDimension,
|
||||
dimension.AnalyticDimensionValue,
|
||||
|
||||
@@ -491,6 +491,13 @@ class Purchase(metaclass=PoolMeta):
|
||||
logger.info("EFP_PRICE:%s",line.unit_price)
|
||||
Line.save([line])
|
||||
|
||||
class PriceComposition(ModelSQL,ModelView):
|
||||
__name__ = 'price.composition'
|
||||
|
||||
line = fields.Many2One('purchase.line',"Purchase line")
|
||||
component = fields.Char("Component")
|
||||
price = fields.Numeric("Price")
|
||||
|
||||
class Line(metaclass=PoolMeta):
|
||||
__name__ = 'purchase.line'
|
||||
|
||||
|
||||
@@ -495,12 +495,11 @@ class Sale(metaclass=PoolMeta):
|
||||
line.unit_price = d.price_index.get_price(Date.today(),line.unit,line.currency,True)
|
||||
Line.save([line])
|
||||
|
||||
class PriceComposition(ModelSQL,ModelView):
|
||||
class PriceComposition(metaclass=PoolMeta):
|
||||
__name__ = 'price.composition'
|
||||
|
||||
component = fields.Char("Component")
|
||||
price = fields.Numeric("Price")
|
||||
|
||||
sale_line = fields.Many2One('sale.line',"Sale line")
|
||||
|
||||
class SaleLine(metaclass=PoolMeta):
|
||||
__name__ = 'sale.line'
|
||||
|
||||
@@ -594,7 +593,7 @@ class SaleLine(metaclass=PoolMeta):
|
||||
)
|
||||
|
||||
pricing_rule = fields.Text("Pricing description")
|
||||
price_composition = fields.One2Many('price.composition',"Price composition")
|
||||
price_composition = fields.One2Many('price.composition','sale_line',"Price composition")
|
||||
|
||||
@property
|
||||
def report_fixing_rule(self):
|
||||
|
||||
Reference in New Issue
Block a user