Add check to mark accounts as debt

issue10164
review357341003
This commit is contained in:
Sergi Almacellas Abellana
2021-04-11 20:51:49 +02:00
parent a9236ca5d3
commit 14e1e67079
4 changed files with 20 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add check to mark types as debt
* Add relate from party to general ledger accounts
* Accumulate start balance on general ledger line
* Print general journal from moves
+15 -1
View File
@@ -93,6 +93,19 @@ def TypeMixin(template=False):
},
depends=['statement', 'assets'])
debt = fields.Boolean(
"Debt",
domain=[
If(Eval('statement') != 'balance',
('debt', '=', False), ()),
],
states={
'invisible': ((Eval('statement') != 'balance')
| Eval('assets', False)),
},
depends=['statement', 'assets'],
help="Check to allow booking debt via supplier invoice.")
revenue = fields.Boolean(
"Revenue",
domain=[
@@ -166,7 +179,8 @@ class TypeTemplate(
if not type or type.assets != self.assets:
res['assets'] = self.assets
for boolean in [
'receivable', 'stock', 'payable', 'revenue', 'expense']:
'receivable', 'stock', 'payable', 'revenue', 'expense',
'debt']:
if not type or getattr(type, boolean) != getattr(self, boolean):
res[boolean] = getattr(self, boolean)
if not type or type.template != self:
+2
View File
@@ -25,6 +25,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="stock" xexpand="0" width="25"/>
<label name="payable"/>
<field name="payable" xexpand="0" width="25"/>
<label name="debt"/>
<field name="debt" xexpand="0" width="25"/>
<label name="revenue"/>
<field name="revenue" xexpand="0" width="25"/>
<label name="expense"/>
+2
View File
@@ -21,6 +21,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="stock" xexpand="0" width="25"/>
<label name="payable"/>
<field name="payable" xexpand="0" width="25"/>
<label name="debt"/>
<field name="debt" xexpand="0" width="25"/>
<label name="revenue"/>
<field name="revenue" xexpand="0" width="25"/>
<label name="expense"/>