[FIX] point_of_sale: fixing pricelist display and install

1. At POS install, search a (mandatory) pricelist only with the user's company's currency, otherwise it crashes at install time
	YourCompany is in USD
	You can have a second pricelist in EUR
	That later one will be selected by the search, hence the crash

2. Pricelist config menu in pos.config should only be visible by users in the relevant group

closes #19792
This commit is contained in:
Lucas Perais (lpe)
2017-09-29 11:24:32 +02:00
parent 48a8d68194
commit f106e59b15
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ class PosConfig(models.Model):
return self.env['account.journal'].search([('type', '=', 'sale'), ('company_id', '=', self.env.user.company_id.id)], limit=1)
def _default_pricelist(self):
return self.env['product.pricelist'].search([], limit=1)
return self.env['product.pricelist'].search([('currency_id', '=', self.env.user.company_id.currency_id.id)], limit=1)
def _get_default_location(self):
return self.env['stock.warehouse'].search([('company_id', '=', self.env.user.company_id.id)], limit=1).lot_stock_id
@@ -239,7 +239,7 @@
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="pricelist_setting" title="Choose a pricelist for the Point Of Sale">
<div class="col-xs-12 col-md-6 o_setting_box" id="pricelist_setting" title="Choose a pricelist for the Point Of Sale" groups="product.group_sale_pricelist">
<div class="o_setting_left_pane">
<field name="use_pricelist"/>
</div>