[IMP] point_of_sale: Add langage for cutstomer details in pos.

Now we can change the language of the customer inside the POS front end.

closes odoo/odoo#37195

Task-id: 1917704
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Robin Heinz
2019-10-28 13:34:20 +00:00
parent bbbfca2d97
commit 8e3be15025
3 changed files with 18 additions and 3 deletions
@@ -36,7 +36,6 @@ class ResPartner(models.Model):
if partner_id: # Modifying existing partner
self.browse(partner_id).write(partner)
else:
partner['lang'] = self.env.user.lang
partner_id = self.create(partner).id
return partner_id
+8 -2
View File
@@ -199,7 +199,7 @@ exports.PosModel = Backbone.Model.extend({
},{
model: 'res.partner',
label: 'load_partners',
fields: ['name','street','city','state_id','country_id','vat',
fields: ['name','street','city','state_id','country_id','vat','lang',
'phone','zip','mobile','email','barcode','write_date',
'property_account_position_id','property_product_pricelist'],
loaded: function(self,partners){
@@ -224,6 +224,12 @@ exports.PosModel = Backbone.Model.extend({
}
}
},
},{
model: 'res.lang',
fields: ['name', 'code'],
loaded: function (self, langs){
self.langs = langs;
},
},{
model: 'account.tax',
fields: ['name','amount', 'price_include', 'include_base_amount', 'amount_type', 'children_tax_ids'],
@@ -294,7 +300,7 @@ exports.PosModel = Backbone.Model.extend({
},
},{
model: 'res.users',
fields: ['name','company_id', 'id', 'groups_id'],
fields: ['name','company_id', 'id', 'groups_id', 'lang'],
domain: function(self){ return [['company_ids', 'in', self.config.company_id[0]],'|', ['groups_id','=', self.config.group_pos_manager_id[0]],['groups_id','=', self.config.group_pos_user_id[0]]]; },
loaded: function(self,users){
users.forEach(function(user) {
@@ -409,6 +409,16 @@
</t>
</select>
</div>
</div>
<div class='client-detail'>
<span class='label'>Language</span>
<select class='detail client-lang needsclick' name='lang'>
<t t-foreach='widget.pos.langs' t-as='lang'>
<option t-att-value='lang.code' t-att-selected="partner.lang ? ((lang.code === partner.lang) ? true : undefined) : lang.code === widget.pos.user.lang? true : undefined">
<t t-esc='lang.name'/>
</option>
</t>
</select>
</div>
<div class='client-details-right'>
<div class='client-detail'>