Merge lp:~camptocamp/openobject-addons/trunk-fix-1245375-afe into lp:openobject-addons

Proposed by Alexandre Fayolle - camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-addons/trunk-fix-1245375-afe
Merge into: lp:openobject-addons
Diff against target: 30 lines (+9/-5)
1 file modified
point_of_sale/point_of_sale.py (+9/-5)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/trunk-fix-1245375-afe
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp (community) code review, no tests Approve
Nicolas Bessi - Camptocamp (community) code review, no test Approve
Guewen Baconnier @ Camptocamp (community) code review Approve
OpenERP Core Team Pending
Review via email: mp+192849@code.launchpad.net

Description of the change

Add extension point to allow customization of account.bank.statement creation in 3rd party addons

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review, no tests)

Unmerged revisions

8959. By Alexandre Fayolle - camptocamp

[FIX] point_of_sale: add extention hook for account.bank.statement creation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'point_of_sale/point_of_sale.py'
--- point_of_sale/point_of_sale.py 2013-10-18 12:58:18 +0000
+++ point_of_sale/point_of_sale.py 2013-10-28 09:11:38 +0000
@@ -303,6 +303,14 @@
303 (_check_pos_config, "You cannot create two active sessions related to the same point of sale!", ['config_id']),303 (_check_pos_config, "You cannot create two active sessions related to the same point of sale!", ['config_id']),
304 ]304 ]
305305
306 def _prepare_bank_statement(self, cr, uid, pos_config, journal, context=None):
307 bank_values = {
308 'journal_id' : journal.id,
309 'user_id' : uid,
310 'company_id' : pos_config.warehouse_id.company_id.id
311 }
312 return bank_values
313
306 def create(self, cr, uid, values, context=None):314 def create(self, cr, uid, values, context=None):
307 context = context or {}315 context = context or {}
308 config_id = values.get('config_id', False) or context.get('default_config_id', False)316 config_id = values.get('config_id', False) or context.get('default_config_id', False)
@@ -340,11 +348,7 @@
340 pos_config = jobj.browse(cr, uid, config_id, context=context)348 pos_config = jobj.browse(cr, uid, config_id, context=context)
341 bank_statement_ids = []349 bank_statement_ids = []
342 for journal in pos_config.journal_ids:350 for journal in pos_config.journal_ids:
343 bank_values = {351 bank_values = self._prepare_bank_statement(cr, uid, pos_config, journal, context)
344 'journal_id' : journal.id,
345 'user_id' : uid,
346 'company_id' : pos_config.warehouse_id.company_id.id
347 }
348 statement_id = self.pool.get('account.bank.statement').create(cr, uid, bank_values, context=context)352 statement_id = self.pool.get('account.bank.statement').create(cr, uid, bank_values, context=context)
349 bank_statement_ids.append(statement_id)353 bank_statement_ids.append(statement_id)
350354

Subscribers

People subscribed via source and target branches

to all changes: