minor fix
This commit is contained in:
parent
059ed231d5
commit
0caadac292
|
@ -81,6 +81,7 @@ def register():
|
|||
account.TrialBalanceDetailed,
|
||||
account.TrialBalanceClassic,
|
||||
account.BalanceSheet,
|
||||
# account.BalanceSheetDetail,
|
||||
account.IncomeStatement,
|
||||
invoice.EquivalentInvoice,
|
||||
account.PartyWithholding,
|
||||
|
|
41
account.py
41
account.py
|
@ -857,7 +857,48 @@ 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)
|
||||
# context = Transaction().context
|
||||
# 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',
|
||||
# # ('parent', '=', None),
|
||||
# # ('parent.statement', '!=', 'balance'),
|
||||
# # ('parent.statement', '=', None)
|
||||
# # ]
|
||||
# # ]
|
||||
|
||||
# # for id_ in ids:
|
||||
# # with Transaction().set_context(context):
|
||||
# # types = Type.search(domain_type)
|
||||
# # print(types, 'types++++++++++++++++++++')
|
||||
# for id_ in ids:
|
||||
# domain = [
|
||||
# ['OR',
|
||||
# ('type', 'child_of', id_, 'parent'),
|
||||
# ('debit_type', 'child_of', id_, 'parent')
|
||||
# ],
|
||||
# ('type', '!=', None),
|
||||
# ('closed', '!=', True)
|
||||
# ]
|
||||
# with Transaction().set_context(context):
|
||||
# accounts = Account.search(domain)
|
||||
|
||||
# report_context['company'] = Company(context.get('company'))
|
||||
# report_context['date'] = context.get('date')
|
||||
# return report_context
|
||||
|
||||
class IncomeStatement(Report):
|
||||
'Income Statement'
|
||||
|
|
14
account.xml
14
account.xml
|
@ -72,6 +72,20 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="action" ref="report_balance_sheet"/>
|
||||
</record>
|
||||
|
||||
<!-- <record model="ir.action.report" id="report_balance_sheet_detailed">
|
||||
<field name="name">Balance Sheet detaile</field>
|
||||
<field name="model">account.account.type</field>
|
||||
<field name="report_name">account.balance_sheet_report</field>
|
||||
<field name="report">account_col/balance_sheet_detailed.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
<field name="translatable">False</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="report_balance_sheet_detailed_keyword">
|
||||
<field name="keyword">form_print</field>
|
||||
<field name="model">account.account.type,-1</field>
|
||||
<field name="action" ref="report_balance_sheet_detailed"/>
|
||||
</record> -->
|
||||
|
||||
<record model="ir.action.report" id="report_income_statement">
|
||||
<field name="name">Income Statement</field>
|
||||
<field name="model">account.account.type</field>
|
||||
|
|
Binary file not shown.
|
@ -36,6 +36,14 @@ class Product(metaclass=PoolMeta):
|
|||
tax_amount.append(line.product.extra_tax * Decimal(line.quantity))
|
||||
return sum(tax_amount)
|
||||
|
||||
@classmethod
|
||||
def get_rec_name(cls, name):
|
||||
if self.code:
|
||||
return '['+ self.code + '] '+self.name
|
||||
else:
|
||||
return self.name
|
||||
|
||||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
domain = super(Product, cls).search_rec_name(name, clause)
|
||||
|
|
Loading…
Reference in New Issue