[IMP][FIX] account: Added context instead of domain in different act windows of partner object, Fixed 'active_id' error in code.
bzr revid: vra@tinyerp.com-20100826094513-2x22qhx6727g6f5t
This commit is contained in:
parent
17d6bbf3c9
commit
f96ee5cded
|
@ -500,7 +500,7 @@
|
|||
</record>
|
||||
<menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
|
||||
|
||||
<act_window domain="[('partner_id','=',active_id)]" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
|
||||
<act_window context="{'search_default_partner_id':[active_id]}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
|
||||
|
||||
<act_window domain="[('journal_id','=',active_id),('state','!=','draft'),('reconciled','=',False)]" id="act_account_journal_2_account_invoice_opened" name="Unpaid invoices" res_model="account.invoice" src_model="account.journal"/>
|
||||
|
||||
|
|
|
@ -1818,9 +1818,9 @@
|
|||
|
||||
<act_window domain="[('journal_id', '=', active_id)]" id="act_account_journal_2_account_move_line" name="Journal Items" res_model="account.move.line" src_model="account.journal"/>
|
||||
|
||||
<act_window context="{'search_default_reconcile_id':False}" domain="[('partner_id', '=', active_id),('reconcile_id','=',False),('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables & Payables" res_model="account.move.line" src_model="res.partner"/>
|
||||
<act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables & Payables" res_model="account.move.line" src_model="res.partner"/>
|
||||
|
||||
<act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner"/>
|
||||
<act_window context="{'search_default_partner_id':[active_id]}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner"/>
|
||||
|
||||
<record id="view_account_addtmpl_wizard_form" model="ir.ui.view">
|
||||
<field name="name">Create Account</field>
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
<act_window
|
||||
id="action_analytic_open"
|
||||
name="Analytic Accounts"
|
||||
res_model="account.analytic.account"
|
||||
domain="[('partner_id','=',active_id)]"
|
||||
res_model="account.analytic.account"
|
||||
context="{'search_default_partner_id':[active_id]}"
|
||||
src_model="res.partner"
|
||||
view_type="form"
|
||||
view_mode="tree,form,graph,calendar"/>
|
||||
|
|
|
@ -156,10 +156,9 @@
|
|||
<menuitem action="action_account_invoice_report_all" id="menu_action_account_invoice_report_all" parent="account.menu_finance_statistic_report_statement" sequence="0"/>
|
||||
|
||||
<act_window
|
||||
domain="[('partner_id', '=', active_id)]"
|
||||
id="act_account_invoice_partner_relation"
|
||||
name="Monthly Turnover"
|
||||
context="{'search_default_month':1,'search_default_user':1,'group_by_no_leaf':1,'group_by':[]}"
|
||||
context="{'search_default_partner_id':[active_id], 'search_default_month':1,'search_default_user':1,'group_by_no_leaf':1,'group_by':[]}"
|
||||
res_model="account.invoice.report"
|
||||
src_model="res.partner"/>
|
||||
|
||||
|
|
|
@ -33,10 +33,11 @@ class account_change_currency(osv.osv_memory):
|
|||
obj_inv = self.pool.get('account.invoice')
|
||||
if context is None:
|
||||
context = {}
|
||||
state = obj_inv.browse(cr, uid, context['active_id']).state
|
||||
if obj_inv.browse(cr, uid, context['active_id']).state != 'draft':
|
||||
raise osv.except_osv(_('Error'), _('You can only change currency for Draft Invoice !'))
|
||||
pass
|
||||
if context.get('active_id',False):
|
||||
state = obj_inv.browse(cr, uid, context['active_id']).state
|
||||
if obj_inv.browse(cr, uid, context['active_id']).state != 'draft':
|
||||
raise osv.except_osv(_('Error'), _('You can only change currency for Draft Invoice !'))
|
||||
pass
|
||||
|
||||
def change_currency(self, cr, uid, ids, context=None):
|
||||
obj_inv = self.pool.get('account.invoice')
|
||||
|
|
Loading…
Reference in New Issue