summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>2012-11-26 10:36:11 +0100
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>2012-11-26 10:36:11 +0100
commit4554f152f542ea0ecf8ab7dbbb3d49cd8700a2e0 (patch)
tree32f950c0eefbec87dbe725e3115f3860b7c86704
parent02f55a72f7c7b095cb4bd3c72901002f10945b94 (diff)
parente06378bca392ebfba90b4610a36d0831c9cc1c0c (diff)
[MERGE] pos: price field used instead of list_price
bzr revid: qdp-launchpad@openerp.com-20121126093611-1l2ujhh4tsryo416
-rw-r--r--addons/point_of_sale/static/src/js/devices.js2
-rw-r--r--addons/point_of_sale/static/src/js/models.js14
-rw-r--r--addons/point_of_sale/static/src/js/screens.js2
-rw-r--r--addons/point_of_sale/static/src/js/widgets.js4
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml10
5 files changed, 16 insertions, 16 deletions
diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js
index 782aac8c101..55e75ebcf42 100644
--- a/addons/point_of_sale/static/src/js/devices.js
+++ b/addons/point_of_sale/static/src/js/devices.js
@@ -202,7 +202,7 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
* {
* quantity: (number) the number of items, or the weight,
* unit_name: (string) the name of the item's unit (kg, dozen, ...)
- * list_price: (number) the price of one unit of the item before discount
+ * price: (number) the price of one unit of the item before discount
* discount: (number) the discount on the product in % [0,100]
* product_name: (string) the name of the product
* price_with_tax: (number) the price paid for this orderline, tax included
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 3adbd19b161..f533fa760ab 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -342,7 +342,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
this.pos = options.pos;
this.order = options.order;
this.product = options.product;
- this.price = options.product.get('list_price');
+ this.price = options.product.get('price');
this.quantity = 1;
this.discount = 0;
this.type = 'unit';
@@ -396,11 +396,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return this.product;
},
// return the base price of this product (for this orderline)
- get_list_price: function(){
+ get_price: function(){
return this.price;
},
// changes the base price of the product for this orderline
- set_list_price: function(price){
+ set_price: function(price){
this.price = price;
this.trigger('change');
},
@@ -434,7 +434,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
export_as_JSON: function() {
return {
qty: this.get_quantity(),
- price_unit: this.get_list_price(),
+ price_unit: this.get_price(),
discount: this.get_discount(),
product_id: this.get_product().get('id'),
};
@@ -444,7 +444,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return {
quantity: this.get_quantity(),
unit_name: this.get_unit().name,
- list_price: this.get_list_price(),
+ price: this.get_price(),
discount: this.get_discount(),
product_name: this.get_product().get('name'),
price_with_tax : this.get_price_with_tax(),
@@ -589,7 +589,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
line.set_quantity(options.quantity);
}
if(options.price !== undefined){
- line.set_list_price(options.price);
+ line.set_price(options.price);
}
var last_orderline = this.getLastOrderline();
@@ -625,7 +625,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
},
getDiscountTotal: function() {
return (this.get('orderLines')).reduce((function(sum, orderLine) {
- return sum + (orderLine.get_list_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
+ return sum + (orderLine.get_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
}), 0);
},
getTotalTaxExcluded: function() {
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 87c541aea81..dd7f55efc37 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -535,7 +535,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
},
get_product_price: function(){
var product = this.get_product();
- return (product ? product.get('list_price') : 0) || 0;
+ return (product ? product.get('price') : 0) || 0;
},
get_product_weight: function(){
return this.weight || 0;
diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js
index 0d7a6cacff2..135c00f198d 100644
--- a/addons/point_of_sale/static/src/js/widgets.js
+++ b/addons/point_of_sale/static/src/js/widgets.js
@@ -184,8 +184,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
order.getSelectedLine().set_quantity(val);
}else if( mode === 'discount'){
order.getSelectedLine().set_discount(val);
- }else if( mode === 'list_price'){
- order.getSelectedLine().set_list_price(val);
+ }else if( mode === 'price'){
+ order.getSelectedLine().set_price(val);
}
} else {
this.pos.get('selectedOrder').destroy();
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 85397c4686a..33935b85d12 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -85,7 +85,7 @@
<button class="input-button number-char">7</button>
<button class="input-button number-char">8</button>
<button class="input-button number-char">9</button>
- <button class="mode-button" data-mode='list_price'>Price</button>
+ <button class="mode-button" data-mode='price'>Price</button>
<br />
<button class="input-button" id="numpad-minus" >+/-</button>
<button class="input-button number-char">0</button>
@@ -387,12 +387,12 @@
<img src='' /> <!-- the product thumbnail -->
<t t-if="!widget.model.get('to_weight')">
<span class="price-tag">
- <t t-esc="widget.format_currency(widget.model.get('list_price'))"/>
+ <t t-esc="widget.format_currency(widget.model.get('price'))"/>
</span>
</t>
<t t-if="widget.model.get('to_weight')">
<span class="price-tag">
- <t t-esc="widget.format_currency(widget.model.get('list_price'))+'/Kg'"/>
+ <t t-esc="widget.format_currency(widget.model.get('price'))+'/Kg'"/>
</span>
</t>
</div>
@@ -510,7 +510,7 @@
</em>
<t t-esc="widget.model.get_unit().name" />
at
- <t t-esc="widget.format_currency(widget.model.get_list_price())" />
+ <t t-esc="widget.format_currency(widget.model.get_price())" />
/
<t t-esc="widget.model.get_unit().name" />
</li>
@@ -584,7 +584,7 @@
<t t-esc="order.get_quantity().toFixed(0)"/>
</td>
<td class="pos-right-align">
- <t t-esc="widget.format_currency(order.get_list_price() * (1 - order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
+ <t t-esc="widget.format_currency(order.get_price() * (1 - order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
</td>
</tr>
</table>