19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -10,5 +10,16 @@ class ResCurrency(models.Model):
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'))
if not self.env.user.has_group('product.group_product_pricelist'):
group_user = self.env.ref('base.group_user').sudo()
group_user._apply_group(self.env.ref('product.group_product_pricelist'))
self.env['res.company']._activate_or_create_pricelists()
def write(self, vals):
""" Archive pricelist when the linked currency is archived. """
res = super().write(vals)
if self and 'active' in vals and not vals['active']:
self.env['product.pricelist'].search([('currency_id', 'in', self.ids)]).action_archive()
return res