Merge lp:~openerp-dev/openobject-addons/trunk-bug-871684-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Merged
Merged at revision: 5539
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-871684-bde
Merge into: lp:openobject-addons
Diff against target: 17 lines (+2/-2)
1 file modified
point_of_sale/wizard/pos_box_entries.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-871684-bde
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Approve
Review via email: mp+79377@code.launchpad.net

Description of the change

Hello Sir,

I have made some modification to make compatible for searching the selected journal in point_of_sale/wizard/pos_box_entries.py.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Have you tested it? I cannot believe it works without crashing...

Read carefully the spec of method read. data['journal_id'] should be a tuple like (id, name); this is why the domain was initially wrong. But invoking int() on it is not better: it will simply raise an exception (cannot convert tuple to int).

I will fix this.
Raphael

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Never mind, I was wrong. It works well!

Sorry,
Raphael

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/wizard/pos_box_entries.py'
2--- point_of_sale/wizard/pos_box_entries.py 2011-10-02 17:31:16 +0000
3+++ point_of_sale/wizard/pos_box_entries.py 2011-10-14 09:25:20 +0000
4@@ -96,11 +96,11 @@
5 for data in self.read(cr, uid, ids, context=context):
6 vals = {}
7 curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id
8- statement_id = statement_obj.search(cr, uid, [('journal_id', '=', data['journal_id']), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context)
9+ statement_id = statement_obj.search(cr, uid, [('journal_id', '=', int(data['journal_id'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context)
10 if not statement_id:
11 raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
12
13- acc_id = product_obj.browse(cr, uid, data['product_id']).property_account_income
14+ acc_id = product_obj.browse(cr, uid, int(data['product_id'])).property_account_income
15 if not acc_id:
16 raise osv.except_osv(_('Error !'), _('Please check that income account is set to %s')%(product_obj.browse(cr, uid, data['product_id']).name))
17 if statement_id:

Subscribers

People subscribed via source and target branches

to all changes: