[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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user