mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 01:52:02 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue