openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #13150
[Bug 1019267] Re: account default journal not using defaults
the journals
select id,name from account_journal where type='sale';
id | name
----+--------------------------------------------------
2 | Journal Verkauf
10 | Journal Verkauf / Büro Hamburg (NICHT VERWENDEN)
12 | Journal Verkauf / Intern (NICHT VERWENDEN)
13 | Journal Verkauf Intern
the log
FGF context {'uid': 1, 'journal_type': 'sale', 'section_id': False, 'default_type': 'out_invoice', 'lang': 'de_DE', 'tz': 'Europe/Vienna', 'search_default_to_do': 1, 'project_id': False, 'type': 'out_invoice', 'department_id': False}
FGF res [13]
FGF res default [2]
13 is returned by the original _get_journal and 2 is the correct value returned by the patched version, but it is not used
see also
https://bugs.launchpad.net/openobject-server/+bug/1019503
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1019267
Title:
account default journal not using defaults
Status in OpenERP Addons (modules):
New
Bug description:
account/account_invoice.py
this code selects an arbitrary (first) journal which matches the
condition
def _get_journal(self, cr, uid, context=None):
if context is None:
context = {}
type_inv = context.get('type', 'out_invoice')
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
company_id = context.get('company_id', user.company_id.id)
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
journal_obj = self.pool.get('account.journal')
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')),
('company_id', '=', company_id)],
limit=1)
the defaults are defined as
select id,name,key2,value from ir_values where model like '%invoi%' and name ='journal_id' ;
id | name | key2 | value
------+------------+---------------+-------
2283 | journal_id | | I2 +
| | | .
2284 | journal_id | partner_id=84 | I13 +
| | | .
2285 | journal_id | partner_id=85 | I13 +
| | | .
2286 | journal_id | partner_id=83 | I13 +
| | | .
(4 rows)
the _get_journal function
must respect the existing defaults
patch follows soon
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1019267/+subscriptions
References