Merge lp:~openerp-dev/openobject-addons/trunk-bug-1115325-ishwar into lp:openobject-addons

Proposed by Ishwar Malvi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1115325-ishwar
Merge into: lp:openobject-addons
Diff against target: 33 lines (+7/-2)
1 file modified
point_of_sale/static/src/js/models.js (+7/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1115325-ishwar
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+155897@code.launchpad.net

Description of the change

Hello,

      I have fixed a problem of pos : pos was taking company currency instead of pricelist currency

Thanks,
Ishwar Malvi

To post a comment you must log in.

Unmerged revisions

8617. By Ishwar Malvi(OpenERP)

[MERGE] with trunk

8616. By Ishwar Malvi(OpenERP)

[FIX] point_of_sale : POS is taking company currency instead of pricelist currency

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'point_of_sale/static/src/js/models.js'
--- point_of_sale/static/src/js/models.js 2013-01-28 17:18:00 +0000
+++ point_of_sale/static/src/js/models.js 2013-03-28 06:48:23 +0000
@@ -49,6 +49,7 @@
49 'nbr_pending_operations': 0, 49 'nbr_pending_operations': 0,
5050
51 'currency': {symbol: '$', position: 'after'},51 'currency': {symbol: '$', position: 'after'},
52 'pricelist_currency': null,
52 'shop': null, 53 'shop': null,
53 'company': null,54 'company': null,
54 'user': null, // the user that loaded the pos55 'user': null, // the user that loaded the pos
@@ -94,7 +95,11 @@
94 // loads all the needed data on the sever. returns a deferred indicating when all the data has loaded. 95 // loads all the needed data on the sever. returns a deferred indicating when all the data has loaded.
95 load_server_data: function(){96 load_server_data: function(){
96 var self = this;97 var self = this;
9798
99 var pricelists = self.fetch('product.pricelist', ['currency_id'],[['write_uid','=',this.session.uid]]).then(function(_pricelists){
100 self.set("pricelist_currency", _pricelists[0]);
101 });
102
98 var loaded = self.fetch('res.users',['name','company_id'],[['id','=',this.session.uid]]) 103 var loaded = self.fetch('res.users',['name','company_id'],[['id','=',this.session.uid]])
99 .then(function(users){104 .then(function(users){
100 self.set('user',users[0]);105 self.set('user',users[0]);
@@ -118,7 +123,7 @@
118 }).then(function(company_partners){123 }).then(function(company_partners){
119 self.get('company').contact_address = company_partners[0].contact_address;124 self.get('company').contact_address = company_partners[0].contact_address;
120125
121 return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('company').currency_id[0]]]);126 return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('pricelist_currency').currency_id[0]]]);
122 }).then(function(currencies){127 }).then(function(currencies){
123 console.log('Currency:',currencies[0]);128 console.log('Currency:',currencies[0]);
124 self.set('currency',currencies[0]);129 self.set('currency',currencies[0]);

Subscribers

People subscribed via source and target branches

to all changes: