[IMP] point_of_sale: allow users to modify pricelist on customers

It's not a common use case for existing customers, but it's probably
useful to have when creating new customers.
This commit is contained in:
Joren Van Onder
2017-08-18 14:55:48 +02:00
committed by Pierre Masereel
parent 861266dce1
commit 0178bf39c4
3 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ exports.PosModel = Backbone.Model.extend({
loaded: function(self, locations){ self.shop = locations[0]; },
},{
model: 'product.pricelist',
fields: ['name'],
fields: ['name', 'display_name'],
domain: function(self) { return [['id', 'in', self.config.available_pricelist_ids]]; },
loaded: function(self, pricelists){
_.map(pricelists, function (pricelist) { pricelist.items = []; });
@@ -1239,6 +1239,12 @@ var ClientListScreenWidget = ScreenWidget.extend({
fields.id = partner.id || false;
fields.country_id = fields.country_id || false;
if (fields.property_product_pricelist) {
fields.property_product_pricelist = parseInt(fields.property_product_pricelist, 10);
} else {
fields.property_product_pricelist = false;
}
rpc.query({
model: 'res.partner',
method: 'create_from_ui',
+12 -1
View File
@@ -384,6 +384,17 @@
<span class='label'>Tax ID</span>
<input class='detail vat' name='vat' t-att-value='partner.vat || ""'></input>
</div>
<div t-attf-class='client-detail #{widget.pos.pricelists.length &lt;= 1 ? "oe_hidden" : ""}'>
<span class='label'>Pricelist</span>
<select class='detail needsclick' name='property_product_pricelist'>
<t t-foreach='widget.pos.pricelists' t-as='pricelist'>
<option t-att-value='pricelist.id'
t-att-selected="partner.property_product_pricelist ? (pricelist.id === partner.property_product_pricelist[0] ? true : undefined) : undefined">
<t t-esc='pricelist.display_name'/>
</option>
</t>
</select>
</div>
</div>
</div>
</section>
@@ -446,7 +457,7 @@
<span class='detail vat empty'>N/A</span>
</t>
</div>
<div class='client-detail'>
<div t-attf-class='client-detail #{widget.pos.pricelists.length &lt;= 1 ? "oe_hidden" : ""}'>
<span class='label'>Pricelist</span>
<t t-if='partner.property_product_pricelist'>
<span class='detail property_product_pricelist'><t t-esc='partner.property_product_pricelist[1]'/></span>