formatting
This commit is contained in:
parent
41e04482d4
commit
53f020b4d0
5 changed files with 150 additions and 224 deletions
|
@ -39,15 +39,18 @@ class Reconciliation(metaclass=PoolMeta):
|
|||
"""
|
||||
recname = super(Reconciliation, self).get_rec_name(name)
|
||||
if self.cashbook.feature == 'asset':
|
||||
recname += ' | %(start_quantity)s %(uom_symbol)s - %(end_quantity)s %(uom_symbol)s' % {
|
||||
'start_quantity': Report.format_number(
|
||||
recname += ' '.join([
|
||||
' |',
|
||||
Report.format_number(
|
||||
self.start_quantity or 0.0, None,
|
||||
digits=self.quantity_digits),
|
||||
'end_quantity': Report.format_number(
|
||||
getattr(self.quantity_uom, 'symbol', '-'),
|
||||
'-',
|
||||
Report.format_number(
|
||||
self.end_quantity or 0.0, None,
|
||||
digits=self.quantity_digits),
|
||||
'uom_symbol': getattr(self.quantity_uom, 'symbol', '-'),
|
||||
}
|
||||
getattr(self.quantity_uom, 'symbol', '-')
|
||||
])
|
||||
return recname
|
||||
|
||||
@fields.depends('cashbook', '_parent_cashbook.quantity_uom')
|
||||
|
@ -82,8 +85,7 @@ class Reconciliation(metaclass=PoolMeta):
|
|||
values = super(Reconciliation, cls).get_values_wfedit(reconciliation)
|
||||
values.update({
|
||||
'start_quantity': Decimal('0.0'),
|
||||
'end_quantity': Decimal('0.0'),
|
||||
})
|
||||
'end_quantity': Decimal('0.0')})
|
||||
return values
|
||||
|
||||
@classmethod
|
||||
|
@ -116,8 +118,7 @@ class Reconciliation(metaclass=PoolMeta):
|
|||
# add quantities of already linked lines
|
||||
values['end_quantity'] += sum([
|
||||
x.quantity_credit - x.quantity_debit
|
||||
for x in reconciliation.lines
|
||||
])
|
||||
for x in reconciliation.lines])
|
||||
|
||||
return values
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue