[IMP]:resolved account module

bzr revid: apa@tinyerp.com-20120605105033-ses82h9j15f94yht
This commit is contained in:
Amit Patel (OpenERP)
2012-06-05 16:20:33 +05:30
parent ccb8d479bb
commit ffcd8f105e
3 changed files with 50 additions and 47 deletions
@@ -60,6 +60,7 @@ class account_invoice_refund(osv.osv_memory):
}
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
if context is None:context = {}
journal_obj = self.pool.get('account.journal')
user_obj = self.pool.get('res.users')
# remove the entry with key 'form_view_ref', otherwise fields_view_get crashes
+48 -47
View File
@@ -77,56 +77,57 @@ class account_move_journal(osv.osv_memory):
@return: Returns a dict that contains definition for fields, views, and toolbars
"""
if context is None:context = {}
res = super(account_move_journal, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
if not view_id:
return res
period_pool = self.pool.get('account.period')
journal_pool = self.pool.get('account.journal')
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
journal = False
if journal_id:
journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name']
journal_string = _("Journal: %s") % tools.ustr(journal)
else:
journal_string = _("Journal: All")
period = False
if period_id:
period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name']
period_string = _("Period: %s") % tools.ustr(period)
separator_string = _("Open Journal Items !")
cancel_string = _("Cancel")
open_string = _("Open")
view = """<?xml version="1.0" encoding="utf-8"?>
<form string="Standard entries">
<separator string="%s" colspan="4"/>
<field name="target_move" />
<newline/>
<group colspan="4" >
<label width="300" string="%s"/>
if context:
if not view_id:
return res
period_pool = self.pool.get('account.period')
journal_pool = self.pool.get('account.journal')
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
journal = False
if journal_id:
journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name']
journal_string = _("Journal: %s") % tools.ustr(journal)
else:
journal_string = _("Journal: All")
period = False
if period_id:
period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name']
period_string = _("Period: %s") % tools.ustr(period)
separator_string = _("Open Journal Items !")
cancel_string = _("Cancel")
open_string = _("Open")
view = """<?xml version="1.0" encoding="utf-8"?>
<form string="Standard entries">
<separator string="%s" colspan="4"/>
<field name="target_move" />
<newline/>
<label width="300" string="%s"/>
</group>
<group colspan="4" col="4">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="%s"/>
<button icon="terp-gtk-go-back-rtl" string="%s" name="action_open_window" default_focus="1" type="object"/>
</group>
</form>""" % (separator_string, journal_string, period_string, cancel_string, open_string)
view = etree.fromstring(view.encode('utf8'))
xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context)
view = xarch
res.update({
'arch': view
})
<group colspan="4" >
<label width="300" string="%s"/>
<newline/>
<label width="300" string="%s"/>
</group>
<group colspan="4" col="4">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="%s"/>
<button icon="terp-gtk-go-back-rtl" string="%s" name="action_open_window" default_focus="1" type="object"/>
</group>
</form>""" % (separator_string, journal_string, period_string, cancel_string, open_string)
view = etree.fromstring(view.encode('utf8'))
xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context)
view = xarch
res.update({
'arch': view
})
return res
def action_open_window(self, cr, uid, ids, context=None):
@@ -67,6 +67,7 @@ class account_common_report(osv.osv_memory):
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
if context is None:context = {}
res = super(account_common_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
if context.get('active_model', False) == 'account.account' and view_id:
doc = etree.XML(res['arch'])