Activate Cash Flow

This commit is contained in:
oscar alvarez 2022-10-11 17:01:06 -05:00
parent 1d81371c6e
commit 7477262cd8
10 changed files with 30 additions and 37 deletions

View File

@ -857,11 +857,11 @@ class BalanceSheet(Report):
account_child_list.append(utility)
child1.childs[0].childs = account_child_list
return report_context
# class BalanceSheetDetail(Report):
# 'Balance Sheet Detail Report'
# __name__ = 'account.balance_sheet_report'
# @classmethod
# def get_context(cls, records, header, data):
# report_context = super().get_context(records, header, data)
@ -869,11 +869,11 @@ class BalanceSheet(Report):
# Company = Pool().get('company.company')
# Account = Pool().get('account.account')
# Type = Pool().get('account.account.type')
# ids = data.get('ids')
# # domain_type = [
# # ('statement', '=', 'balance'),
# # ['OR',
# # ['OR',
# # ('parent', '=', None),
# # ('parent.statement', '!=', 'balance'),
# # ('parent.statement', '=', None)
@ -884,9 +884,9 @@ class BalanceSheet(Report):
# # with Transaction().set_context(context):
# # types = Type.search(domain_type)
# # print(types, 'types++++++++++++++++++++')
# for id_ in ids:
# for id_ in ids:
# domain = [
# ['OR',
# ['OR',
# ('type', 'child_of', id_, 'parent'),
# ('debit_type', 'child_of', id_, 'parent')
# ],
@ -1012,7 +1012,6 @@ class CashflowTemplate(ModelSQL, ModelView):
@classmethod
def validate(cls, records):
super(CashflowTemplate, cls).validate(records)
cls.check_recursion(records, rec_name='name')
@staticmethod
def order_sequence(tables):
@ -1132,12 +1131,6 @@ class Cashflow(ModelSQL, ModelView):
@classmethod
def validate(cls, cashflows):
super(Cashflow, cls).validate(cashflows)
cls.check_recursion(cashflows, rec_name='name')
@staticmethod
def order_sequence(tables):
table, _ = tables[None]
return [table.sequence is None, table.sequence]
@staticmethod
def default_balance_sheet():
@ -1152,7 +1145,8 @@ class Cashflow(ModelSQL, ModelView):
return 'debit-credit'
def get_currency_digits(self, name):
return self.company.currency.digits
if self.company and self.company.currency:
return self.company.currency.digits
@classmethod
def get_ctx(cls, fiscalyear=False):
@ -1216,8 +1210,8 @@ class Cashflow(ModelSQL, ModelView):
@classmethod
def delete(cls, cashflows):
cashflows = cls.search([
('parent', 'child_of', [t.id for t in cashflows]),
])
('parent', 'child_of', [t.id for t in cashflows]),
])
super(Cashflow, cls).delete(cashflows)
def update_cashflow(self, template2cashflow=None):
@ -1516,7 +1510,7 @@ class PartyWithholding(Report):
result = cursor.fetchall()
res_dict = {}
moves_ids = set()
for row in result:
row_dict = {}
key_id = str(row[0])+row[1]
@ -1547,7 +1541,7 @@ class PartyWithholding(Report):
columns = list(cursor.description)
result = cursor.fetchall()
res_dict = {}
for row in result:
row_dict = {}
key_id = str(row[0])+row[1]+str(row[3])

View File

@ -106,7 +106,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">account_form</field>
</record>
<!-- <record model="ir.ui.view" id="account_cashflow_template_view_form">
<record model="ir.ui.view" id="account_cashflow_template_view_form">
<field name="model">account.account.cashflow.template</field>
<field name="type">form</field>
<field name="name">account_cashflow_template_form</field>
@ -164,7 +164,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">account_cashflow_list</field>
</record>
<record model="ir.action.report" id="report_cashflow_statement">
<!-- <record model="ir.action.report" id="report_cashflow_statement">
<field name="name">Cash Flow Statement</field>
<field name="model">account.account.cashflow</field>
<field name="report_name">account.cashflow_statement</field>
@ -176,7 +176,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="keyword">form_print</field>
<field name="model">account.account.cashflow,-1</field>
<field name="action" ref="report_cashflow_statement"/>
</record>
</record> -->
<record model="ir.action.act_window" id="act_account_cashflow_tree">
<field name="name">Account Cashflows</field>
@ -255,7 +255,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record> -->
</record>
<record model="ir.ui.view" id="print_party_withholding_start_view_form">
<field name="model">account.party_withholding.start</field>

Binary file not shown.

Binary file not shown.

View File

@ -110,7 +110,7 @@ class Party(ModelSQL, ModelView):
born_city = fields.Many2One('party.city_code', 'City Born', domain=[
('department', '=', Eval('born_subdivision')),
], depends=['born_subdivision'])
@classmethod
def __setup__(cls):
super(Party, cls).__setup__()
@ -123,7 +123,7 @@ class Party(ModelSQL, ModelView):
cls.second_name.states['invisible'] = ~Eval('type_person').in_(['persona_natural'])
cls.first_family_name.states['invisible'] = ~Eval('type_person').in_(['persona_natural'])
cls.second_family_name.states['invisible'] = ~Eval('type_person').in_(['persona_natural'])
@classmethod
def search_rec_name(cls, name, clause):
parties = cls.search([
@ -527,12 +527,11 @@ class BankAccountNumber(ModelSQL, ModelView):
class Address(ModelSQL, ModelView):
__name__ = 'party.address'
country_code = fields.Many2One('party.country_code', 'Country')
department_code = fields.Many2One('party.department_code',
'Department')
department_code = fields.Many2One('party.department_code', 'Department')
city_code = fields.Many2One('party.city_code', 'City',
domain=[
('department', '=', Eval('department_code')),
])
domain=[
('department', '=', Eval('department_code')),
])
@staticmethod
def default_country_code():

View File

@ -1,5 +1,5 @@
[tryton]
version=6.0.9
version=6.0.10
depends:
ir
res

View File

@ -7,7 +7,7 @@ this repository contains the full copyright notices and license terms. -->
<label name="sequence"/>
<field name="sequence"/>
<label name="company"/>
<field name="company"/>
<field name="company" widget="selection"/>
<label name="parent"/>
<field name="parent"/>
<label name="display_balance"/>

View File

@ -2,6 +2,6 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree keyword_open="1">
<field name="name"/>
<field name="amount"/>
<field name="name" expand="1"/>
<field name="amount" expand="1"/>
</tree>

View File

@ -2,7 +2,7 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="name"/>
<field name="name" expand="1"/>
<field name="parent" tree_invisible="1"/>
<field name="childs" tree_invisible="1"/>
</tree>

View File

@ -3,11 +3,11 @@
this repository contains the full copyright notices and license terms. -->
<form>
<label name="fiscalyear"/>
<field name="fiscalyear"/>
<field name="fiscalyear" widget="selection"/>
<label name="company"/>
<field name="company"/>
<field name="company" widget="selection"/>
<label name="period"/>
<field name="period"/>
<field name="period" widget="selection"/>
<label name="posted"/>
<field name="posted"/>
</form>