Compare commits
2 Commits
6d9e63f64f
...
88ad859cdd
Author | SHA1 | Date |
---|---|---|
Albert Cervera i Areny | 88ad859cdd | |
Raimon Esteve | 4fd8dd6fc2 |
|
@ -0,0 +1,36 @@
|
|||
diff --git a/tryton/modules/account/move.py b/tryton/modules/account/move.py
|
||||
index b827237af4..ddbca0ae19 100644
|
||||
--- a/tryton/modules/account/move.py
|
||||
+++ b/tryton/modules/account/move.py
|
||||
@@ -1098,7 +1098,7 @@ class Line(MoveLineMixin, ModelSQL, ModelView):
|
||||
def on_change_move(self):
|
||||
if self.move:
|
||||
if not self.debit and not self.credit:
|
||||
- total = sum(l.debit - l.credit
|
||||
+ total = sum((l.debit or 0) - (l.credit or 0)
|
||||
for l in getattr(self.move, 'lines', []))
|
||||
self.debit = -total if total < 0 else Decimal(0)
|
||||
self.credit = total if total > 0 else Decimal(0)
|
||||
@@ -1169,7 +1169,8 @@ class Line(MoveLineMixin, ModelSQL, ModelView):
|
||||
'Set correct sign to amount_second_currency'
|
||||
if self.amount_second_currency:
|
||||
self.amount_second_currency = \
|
||||
- self.amount_second_currency.copy_sign(self.debit - self.credit)
|
||||
+ self.amount_second_currency.copy_sign(
|
||||
+ (self.debit or 0) - (self.credit or 0))
|
||||
|
||||
@fields.depends('account')
|
||||
def on_change_account(self):
|
||||
@@ -2402,9 +2403,11 @@ class ReconcileShow(ModelView):
|
||||
if self.currency:
|
||||
for line in self.lines:
|
||||
if line.second_currency == self.currency:
|
||||
- amount += line.amount_second_currency
|
||||
+ amount += (
|
||||
+ line.amount_second_currency or 0)
|
||||
elif line.currency == self.currency:
|
||||
- amount += line.debit - line.credit
|
||||
+ amount += (
|
||||
+ (line.debit or 0) - (line.credit or 0))
|
||||
amount = self.currency.round(amount)
|
||||
self.write_off_amount = amount
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/tryton/trytond/trytond/modules/product_price_list/price_list.py b/trytond/trytond/modules/product_price_list/price_list.py
|
||||
index 8d7299ed58..4c68662e1d 100644
|
||||
--- a/tryton/trytond/trytond/modules/product_price_list/price_list.py
|
||||
+++ b/tryton/trytond/trytond/modules/product_price_list/price_list.py
|
||||
@@ -85,8 +85,8 @@ class PriceList(DeactivableMixin, ModelSQL, ModelView):
|
||||
return {
|
||||
'names': {
|
||||
'unit_price': unit_price if unit_price is not None else Null(),
|
||||
- 'cost_price': cost_price if unit_price is not None else Null(),
|
||||
- 'list_price': list_price if unit_price is not None else Null(),
|
||||
+ 'cost_price': cost_price if cost_price is not None else Null(),
|
||||
+ 'list_price': list_price if list_price is not None else Null(),
|
||||
},
|
||||
}
|
||||
|
4
series
4
series
|
@ -65,3 +65,7 @@ sao_document_field.diff # [sao] fix issue with loading of 'document' fields in s
|
|||
issue12799.diff # [sao] Convert negative id value as None when set by the client
|
||||
|
||||
issue12547.diff # [stock_lot] Check lot required only when changing move to done
|
||||
|
||||
issue12823.diff # [account] Use 0 as fallback for missing debit or credit in on_change functions
|
||||
|
||||
product_price_list.diff # [product_price_list] Fix cost_price and list_price values
|
||||
|
|
Loading…
Reference in New Issue