Automatically activate `group_multi_currency` if there is more than one active currency, deactivate it if there is only one active currency retain sale/pos feature of activating group_product_pricelist adapt tests accordingly Task 2610735 closes odoo/odoo#74396 Related: odoo/enterprise#20106 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
15 lines
492 B
Python
15 lines
492 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class ResCurrency(models.Model):
|
|
_inherit = 'res.currency'
|
|
|
|
def _activate_group_multi_currency(self):
|
|
# for Sale/ POS - Multi currency flows require pricelists
|
|
super()._activate_group_multi_currency()
|
|
group_user = self.env.ref('base.group_user').sudo()
|
|
group_user._apply_group(self.env.ref('product.group_product_pricelist'))
|