Merge lp:~cubicerp/openobject-addons/IMP-point-of-sale-to-addapt-to-country-regulations into lp:openobject-addons/7.0

Proposed by Cubic ERP
Status: Needs review
Proposed branch: lp:~cubicerp/openobject-addons/IMP-point-of-sale-to-addapt-to-country-regulations
Merge into: lp:openobject-addons/7.0
Diff against target: 38 lines (+9/-5)
1 file modified
point_of_sale/point_of_sale.py (+9/-5)
To merge this branch: bzr merge lp:~cubicerp/openobject-addons/IMP-point-of-sale-to-addapt-to-country-regulations
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+181285@code.launchpad.net

Description of the change

Improvement on two methods of point_of_sale module, in order to support customizations for some countries with government regulations about the point of sales.

To post a comment you must log in.

Unmerged revisions

9369. By Cubic ERP

[IMP] Improvement point_of_sale in order to accomplish the country regulations through the inheritance modules

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/point_of_sale.py'
2--- point_of_sale/point_of_sale.py 2013-08-14 14:02:40 +0000
3+++ point_of_sale/point_of_sale.py 2013-08-21 12:46:45 +0000
4@@ -656,7 +656,8 @@
5 }
6
7 def create(self, cr, uid, values, context=None):
8- values['name'] = self.pool.get('ir.sequence').get(cr, uid, 'pos.order')
9+ if values['name'] == '/':
10+ values['name'] = self.pool.get('ir.sequence').get(cr, uid, 'pos.order')
11 return super(pos_order, self).create(cr, uid, values, context=context)
12
13 def test_paid(self, cr, uid, ids, context=None):
14@@ -901,6 +902,12 @@
15 def create_account_move(self, cr, uid, ids, context=None):
16 return self._create_account_move_line(cr, uid, ids, None, None, context=context)
17
18+ def get_account_move_create(self, cr, uid, order, context=None):
19+ return {
20+ 'ref' : order.name,
21+ 'journal_id': order.sale_journal.id,
22+ }
23+
24 def _create_account_move_line(self, cr, uid, ids, session=None, move_id=None, context=None):
25 # Tricky, via the workflow, we only have one id in the ids variable
26 """Create a account move line of order grouped by products or not."""
27@@ -952,10 +959,7 @@
28
29 if move_id is None:
30 # Create an entry for the sale
31- move_id = account_move_obj.create(cr, uid, {
32- 'ref' : order.name,
33- 'journal_id': order.sale_journal.id,
34- }, context=context)
35+ move_id = account_move_obj.create(cr, uid, self.get_account_move_create(cr, uid, order, context=context), context=context)
36
37 def insert_data(data_type, values):
38 # if have_to_group_by: