[FIX] point_of_sale: Deactivate pricelist from res config.
This commit prevent the use of the pricelist in the pos after deactivating the option in the res config setting. Before, the xml was not shown anymore but the option use_pricelist was still True and we could still see the pricelist in the frontend of the POS. We were unable to change the option in the backend. Now, when we untick the option in the res config setting, we disable all 'use_pricelist' in the pos configs. closes odoo/odoo#41613 Task-id: 2151669 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
@@ -10,3 +10,10 @@ class ResConfigSettings(models.TransientModel):
|
||||
module_pos_mercury = fields.Boolean(string="Vantiv Payment Terminal", help="The transactions are processed by Vantiv. Set your Vantiv credentials on the related payment method.")
|
||||
module_pos_adyen = fields.Boolean(string="Adyen Payment Terminal", help="The transactions are processed by Adyen. Set your Adyen credentials on the related payment method.")
|
||||
update_stock_quantities = fields.Selection(related="company_id.point_of_sale_update_stock_quantities", readonly=False)
|
||||
|
||||
def set_values(self):
|
||||
super(ResConfigSettings, self).set_values()
|
||||
if not self.group_product_pricelist:
|
||||
configs = self.env['pos.config'].search([('use_pricelist', '=', True)])
|
||||
for config in configs:
|
||||
config.use_pricelist = False
|
||||
|
||||
Reference in New Issue
Block a user