Compare commits
No commits in common. "2c9bcc82ce31a710d396c160e4d2a45b156fa85e" and "2bf689ef871c0593ae858a54385d50e2e58c5601" have entirely different histories.
2c9bcc82ce
...
2bf689ef87
11
sale.py
11
sale.py
@ -13,10 +13,9 @@ class Sale(metaclass=PoolMeta):
|
|||||||
__name__ = 'sale.sale'
|
__name__ = 'sale.sale'
|
||||||
|
|
||||||
pizza_number = fields.Integer("Number pizza")
|
pizza_number = fields.Integer("Number pizza")
|
||||||
total_discount = fields.Function(
|
total_discount = fields.Function(Monetary("Total Discount", currency='currency', digits='currency'),
|
||||||
Monetary("Total Discount", digits='currency', currency='currency'), 'get_amount')
|
'get_amount')
|
||||||
total_discount_cache = Monetary(
|
total_discount_cache = Monetary("Total Discount cache", currency='currency', digits='currency')
|
||||||
"Total Discount cache", digits='currency', currency='currency')
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
@ -98,8 +97,7 @@ class Sale(metaclass=PoolMeta):
|
|||||||
return dict([
|
return dict([
|
||||||
('resolution_number', resolution.resolution_number),
|
('resolution_number', resolution.resolution_number),
|
||||||
('resolution_prefix', resolution.prefix),
|
('resolution_prefix', resolution.prefix),
|
||||||
('valid_date_time_from', str(
|
('valid_date_time_from', str(resolution.valid_date_time_from)),
|
||||||
resolution.valid_date_time_from)),
|
|
||||||
('valid_date_time_to', str(resolution.valid_date_time_to)),
|
('valid_date_time_to', str(resolution.valid_date_time_to)),
|
||||||
('from_number', resolution.from_number),
|
('from_number', resolution.from_number),
|
||||||
('to_number', resolution.to_number)])
|
('to_number', resolution.to_number)])
|
||||||
@ -150,7 +148,6 @@ class Sale(metaclass=PoolMeta):
|
|||||||
if line.type != 'title' and line.taxes else None
|
if line.type != 'title' and line.taxes else None
|
||||||
} for line in record.lines]
|
} for line in record.lines]
|
||||||
|
|
||||||
data["total_discount"] = str(round(record.total_discount,2))
|
|
||||||
data["untaxed_amount"] = str(record.untaxed_amount)
|
data["untaxed_amount"] = str(record.untaxed_amount)
|
||||||
data["tax_amount"] = str(record.tax_amount)
|
data["tax_amount"] = str(record.tax_amount)
|
||||||
data["total"] = str(record.total_amount)
|
data["total"] = str(record.total_amount)
|
||||||
|
Loading…
Reference in New Issue
Block a user