Welcome | Get started | Dive into Lino | Contribute | Reference
lino_xl.lib.ledger.fields¶
Database fields for lino_xl.lib.ledger.
Classes
|
An editable virtual PriceField to get and set both database fields |
- class lino_xl.lib.ledger.fields.DcAmountField(dc, *args, **kwargs)¶
Bases:
VirtualField
An editable virtual PriceField to get and set both database fields
amount
anddc
at once. It may be used only on models which also defines these two fields.When the amount is positive and dc is DC.debit, return None. When the amount is positive and dc is DC.credit, return amount. When the amount is negative and dc is DC.debit, return -amount. When the amount is negative and dc is DC.credit, return None.