[IMP] base_global_discount: add specific security group

This way, it will be easier to decide who can set discount or not. The
current group scope is too broad.
This commit is contained in:
david
2020-12-11 16:38:12 +01:00
parent ec3123c72b
commit ca68d56219
9 changed files with 43 additions and 8 deletions

View File

@@ -20,3 +20,15 @@ class ResPartner(models.Model):
string='Purchase Global Discounts',
domain=[('discount_scope', '=', 'purchase')],
)
# HACK: Looks like UI doesn't behave well with Many2many fields and
# negative groups when the same field is shown. In this case, we want to
# show the readonly version to any not in the global discount group.
# TODO: Check if it's fixed in future versions
customer_global_discount_ids_readonly = fields.Many2many(
related="customer_global_discount_ids",
readonly=True,
)
supplier_global_discount_ids_readonly = fields.Many2many(
related="customer_global_discount_ids",
readonly=True,
)