← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 731465] Re: [6.0] account invoice - can not set default currency

 

Hello,

The working of gtk seems fine because what it does is that when a new record request has been done by the user the gtk client gets all the default_values of that model then fills all the fields. here say we have set 'default' on currency field with value as 'INR' here is what gtk client does It gets all the default values of the model then sets the value in the field now as 'journal_id' has a default value and also an onchange on it so after setting the value the on_change will be triggered and this on_change returns the "journal.currency and journal.currency.id or journal.company_id.currency_id.id"and that new value will be set in the currency field. which replaces the default value.
NOTE: the field with on_change + default set are processed later then the fields with only default values.


"Look at the debug_rpc_answer" log for more details." ,

DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('account.invoice', 'default_get', ['origin', 'comment', 'date_due', 'check_total', 'reference', 'payment_term', 'number', 'journal_id', 'currency_id', 'address_invoice_id', 'tax_line', 'fiscal_position', 'user_id', 'partner_bank_id', 'partner_id', 'reference_type', 'company_id', 'amount_tax', 'state', 'type', 'invoice_line', 'account_id', 'payment_ids', 'reconciled', 'residual', 'date_invoice', 'period_id', 'amount_untaxed', 'move_id', 'amount_total', 'name', 'address_contact_id'], {'lang': u'en_US', 'project_id': False, 'tz': False, 'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'section_id': False, 'active_ids': [213], 'type': 'in_invoice', 'active_id': 213}))
DEBUG_RPC_ANSWER:rpc.result:{'user_id': 1, 'reference_type': 'none', 'journal_id': 18, 'company_id': 1, 'currency_id': 21, 'state': 'draft', 'check_total': 0.0, 'type': 'in_invoice'}
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('res.users', 'name_get', [1], {'lang': u'en_US', 'project_id': False, 'tz': False, 'section_id': False}))
DEBUG_RPC_ANSWER:rpc.result:[(1, u'Administrator')]
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('res.currency', 'name_get', [21], {'lang': u'en_US', 'project_id': False, 'tz': False, 'section_id': False}))
DEBUG_RPC_ANSWER:rpc.result:[(21, u'INR (Rs)')]
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('ir.values', 'get', 'default', u'type=in_invoice', [('account.invoice', False)], False, {}))
DEBUG_RPC_ANSWER:rpc.result:[]
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('account.invoice', 'onchange_journal_id', [], 18))
DEBUG_RPC_ANSWER:rpc.result:{'value': {'currency_id': 1}}
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('res.currency', 'name_get', [1], {'lang': u'en_US', 'project_id': False, 'tz': False, 'section_id': False}))
DEBUG_RPC_ANSWER:rpc.result:[(1, u'EUR (\u20ac)')]
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('ir.values', 'get', 'default', u'company_id=1', [('account.invoice', False)], False, {}))
DEBUG_RPC_ANSWER:rpc.result:[]
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('account.invoice', 'onchange_company_id', [], 1, False, 'in_invoice', [], 1))
DEBUG_RPC_ANSWER:rpc.result:{'domain': {'journal_id': [('id', 'in', [18, 3])]}, 'value': {'currency_id': 1, 'journal_id': 18}}
DEBUG_RPC:rpc.request:('execute', 'crm', 1, '*', ('res.currency', 'name_get', [1], {'lang': u'en_US', 'project_id': False, 'tz': False, 'section_id': False}))
DEBUG_RPC_ANSWER:rpc.result:[(1, u'EUR (\u20ac)')]

@mra
BTW web-client too behaves the same as GTK client.
Try clearing cookies.


Thanks

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/731465

Title:
  [6.0] account invoice - can not set default currency

Status in OpenERP GTK Client:
  Confirmed

Bug description:
  even admin can not set and save the default currency  (to EUR)
  currency for every "new" invoice is empty.



References