09.03.26
This commit is contained in:
@@ -312,7 +312,7 @@ class Purchase(metaclass=PoolMeta):
|
||||
if self.lines[0].price_type == 'priced':
|
||||
return amount_to_currency_words(self.lines[0].unit_price)
|
||||
elif self.lines[0].price_type == 'basis':
|
||||
return amount_to_currency_words(self.lines[0].unit_price) + ' ' + self.lines[0].get_pricing_text()
|
||||
return amount_to_currency_words(self.lines[0].unit_price)
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
@@ -278,6 +278,22 @@ class Sale(metaclass=PoolMeta):
|
||||
else:
|
||||
return ''
|
||||
|
||||
@property
|
||||
def get_pricing_text(self):
|
||||
pricing_text = ''
|
||||
if self.price_components:
|
||||
for pc in self.price_components:
|
||||
if pc.price_index:
|
||||
pricing_text += ' ' + pc.price_index.description
|
||||
return pricing_text
|
||||
|
||||
@property
|
||||
def report_fixing_rule(self):
|
||||
pricing_rule = ''
|
||||
if self.lines:
|
||||
pricing_rule = self.lines[0].pricing_rule
|
||||
return pricing_rule
|
||||
|
||||
@property
|
||||
def report_price(self):
|
||||
if self.lines:
|
||||
@@ -539,6 +555,8 @@ class SaleLine(metaclass=PoolMeta):
|
||||
fields.Char("Attributes Name"),
|
||||
'on_change_with_attributes_name'
|
||||
)
|
||||
|
||||
pricing_rule = fields.Text("Pricing description")
|
||||
|
||||
@fields.depends('product')
|
||||
def on_change_with_attribute_set(self, name=None):
|
||||
@@ -585,14 +603,6 @@ class SaleLine(metaclass=PoolMeta):
|
||||
LotQt = Pool().get('lot.qt')
|
||||
return LotQt.search([('lot_s','=',self.lots[0].id),('lot_p','>',0)])
|
||||
|
||||
def get_pricing_text(self):
|
||||
pricing_text = ''
|
||||
if self.price_components:
|
||||
for pc in self.price_components:
|
||||
if pc.price_index:
|
||||
pricing_text += ' ' + pc.price_index.description
|
||||
return pricing_text
|
||||
|
||||
def get_date(self,trigger_event):
|
||||
trigger_date = None
|
||||
if self.estimated_date:
|
||||
|
||||
@@ -76,6 +76,10 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<page string="Summary" col="4" id="summary">
|
||||
<field name="price_summary" />
|
||||
</page>
|
||||
<page string="Report" col="4" id="report">
|
||||
<label name="pricing_rule" />
|
||||
<field name="pricing_rule" />
|
||||
</page>
|
||||
</notebook>
|
||||
</page>
|
||||
<page string="Estimated dates" col="4" id="estimated">
|
||||
|
||||
Reference in New Issue
Block a user