Merge lp:~openerp-dev/openobject-addons/trunk-bug-1099400-fka into lp:openobject-addons

Proposed by Foram Katharotiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1099400-fka
Merge into: lp:openobject-addons
Diff against target: 37 lines (+16/-3)
1 file modified
point_of_sale/static/src/js/models.js (+16/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1099400-fka
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+144302@code.launchpad.net

Description of the change

Hello,

 - I have fixed the issue of add several lines of product in pos frontend session when add same product after onther product.

Thanks,
FKA

To post a comment you must log in.
8514. By Foram Katharotiya (OpenERP)

[IMP] improve code

8515. By Foram Katharotiya (OpenERP)

[MERGE] with trunk

8516. By Foram Katharotiya (OpenERP)

[MERGE] with trunk

Unmerged revisions

8516. By Foram Katharotiya (OpenERP)

[MERGE] with trunk

8515. By Foram Katharotiya (OpenERP)

[MERGE] with trunk

8514. By Foram Katharotiya (OpenERP)

[IMP] improve code

8513. By Foram Katharotiya (OpenERP)

[FIX]the problem of sevral lines of one products in pos order

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/static/src/js/models.js'
2--- point_of_sale/static/src/js/models.js 2013-01-11 14:42:19 +0000
3+++ point_of_sale/static/src/js/models.js 2013-02-01 13:06:21 +0000
4@@ -578,6 +578,7 @@
5 var attr = product.toJSON();
6 attr.pos = this.pos;
7 attr.order = this;
8+ var exiting =[]
9 var line = new module.Orderline({}, {pos: this.pos, order: this, product: product});
10
11 if(options.quantity !== undefined){
12@@ -588,10 +589,22 @@
13 }
14
15 var last_orderline = this.getLastOrderline();
16- if( last_orderline && last_orderline.can_be_merged_with(line) && options.merge !== false){
17- last_orderline.merge(line);
18- }else{
19+ if (this.get('orderLines').models.length == 0 ){
20 this.get('orderLines').add(line);
21+ }else{
22+ this.get('orderLines').each(function(orderlines){
23+ exiting.push(orderlines.product.id);
24+ });
25+ if (exiting.indexOf(line.product.id) != -1 && last_orderline.product.id != line.product.id)
26+ {
27+ this.get('orderLines').models[exiting.indexOf(line.product.id)].merge(line);
28+ }
29+ else if (last_orderline && exiting.indexOf(line.product.id) != -1 && last_orderline.can_be_merged_with(line) && options.merge !== false){
30+ last_orderline.merge(line);
31+ }
32+ else{
33+ this.get('orderLines').add(line);
34+ }
35 }
36 this.selectLine(this.getLastOrderline());
37 },

Subscribers

People subscribed via source and target branches

to all changes: