Add manual pricing
This commit is contained in:
@@ -119,14 +119,17 @@ class Pricing(metaclass=PoolMeta):
|
||||
sale_line = fields.Many2One('sale.line',"Lines")
|
||||
unit = fields.Function(fields.Many2One('product.uom',"Unit"),'get_unit_sale')
|
||||
|
||||
def get_unit_sale(self,name):
|
||||
if self.sale_line:
|
||||
return self.sale_line.unit
|
||||
|
||||
def get_eod_price_sale(self):
|
||||
if self.sale_line:
|
||||
return round((self.fixed_qt * self.fixed_qt_price + self.unfixed_qt * self.unfixed_qt_price)/Decimal(self.sale_line.quantity),4)
|
||||
return Decimal(0)
|
||||
def get_unit_sale(self,name):
|
||||
if self.sale_line:
|
||||
return self.sale_line.unit
|
||||
|
||||
def get_eod_price_sale(self):
|
||||
return self._weighted_average_price(
|
||||
self.fixed_qt,
|
||||
self.fixed_qt_price,
|
||||
self.unfixed_qt,
|
||||
self.unfixed_qt_price,
|
||||
)
|
||||
|
||||
class Summary(ModelSQL,ModelView):
|
||||
"Pricing summary"
|
||||
|
||||
Reference in New Issue
Block a user