[MERGE]: account: l10n fullness and inheritancy : added reference to COA template in account template
bzr revid: rpa@tinyerp.com-20110831124825-m6pno81m6df1pdqm
This commit is contained in:
@@ -2340,6 +2340,7 @@ class account_account_template(osv.osv):
|
||||
'child_parent_ids':fields.one2many('account.account.template', 'parent_id', 'Children'),
|
||||
'tax_ids': fields.many2many('account.tax.template', 'account_account_template_tax_rel', 'account_id', 'tax_id', 'Default Taxes'),
|
||||
'nocreate': fields.boolean('Optional create', help="If checked, the new chart of accounts will not contain this by default."),
|
||||
'chart_template_id': fields.many2one('account.chart.template', 'Chart Template'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -2376,6 +2377,18 @@ class account_account_template(osv.osv):
|
||||
res.append((record['id'],name ))
|
||||
return res
|
||||
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
# This method is used to get only account templates relavant to the current COA template
|
||||
# but not sure of it, if its really to be used, put proper value of context in xml to use it
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get("coa_template"):
|
||||
args += ['|',('chart_template_id', '=', context.get("coa_template")),('chart_template_id', '=', False)]
|
||||
return super(account_account_template, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
|
||||
def generate_account(self, cr, uid, account_root_id, tax_template_ref, code_digits, company_id, context=None):
|
||||
"""
|
||||
This method for generating accounts from templates.
|
||||
|
||||
@@ -2064,6 +2064,7 @@
|
||||
|
||||
<field name="currency_id"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="chart_template_id"/>
|
||||
<separator string="Default taxes" colspan="4"/>
|
||||
<field name="tax_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
Reference in New Issue
Block a user