Add posted option on open account chart
This commit is contained in:
+8
-1
@@ -286,6 +286,10 @@ class OpenChartAccountInit(WizardOSV):
|
||||
_name = 'account.account.open_chart_account.init'
|
||||
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
|
||||
help='Keep empty for all open fiscal year')
|
||||
posted = fields.Boolean('Posted Move', help='Only posted move')
|
||||
|
||||
def default_posted(self, cursor, user, context=None):
|
||||
return False
|
||||
|
||||
OpenChartAccountInit()
|
||||
|
||||
@@ -324,7 +328,10 @@ class OpenChartAccount(Wizard):
|
||||
model_data = model_data_obj.browse(cursor, user, model_data_ids[0],
|
||||
context=context)
|
||||
res = act_window_obj.read(cursor, user, model_data.db_id, context=context)
|
||||
res['context'] = str({'fiscalyear': data['form']['fiscalyear']})
|
||||
res['context'] = str({
|
||||
'fiscalyear': data['form']['fiscalyear'],
|
||||
'posted': data['form']['posted'],
|
||||
})
|
||||
return res
|
||||
|
||||
OpenChartAccount()
|
||||
|
||||
+15
@@ -320,6 +320,21 @@
|
||||
<field name="company" ref="company.main"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="open_chart_account_init_view_form">
|
||||
<field name="model">account.account.open_chart_account.init</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<![CDATA[
|
||||
<form string="Open Chart of Account" col="2">
|
||||
<label name="fiscalyear"/>
|
||||
<field name="fiscalyear"/>
|
||||
<label name="posted"/>
|
||||
<field name="posted"/>
|
||||
</form>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="print_general_ledger_init_view_form">
|
||||
<field name="model">account.account.open_general_ledger.init</field>
|
||||
<field name="type">form</field>
|
||||
|
||||
@@ -1183,10 +1183,13 @@ class OpenAccount(Wizard):
|
||||
model_data = model_data_obj.browse(cursor, user, model_data_ids[0],
|
||||
context=context)
|
||||
res = act_window_obj.read(cursor, user, model_data.db_id, context=context)
|
||||
res['domain'] = str([
|
||||
res['domain'] = [
|
||||
('period', 'in', period_ids),
|
||||
('account', '=', data['id']),
|
||||
])
|
||||
]
|
||||
if context.get('posted'):
|
||||
res['domain'].append(('move.state', '=', 'posted'))
|
||||
res['domain'] = str(res['domain'])
|
||||
res['context'] = str({'fiscalyear': context.get('fiscalyear')})
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user