[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.

[UPD] Update base_global_discount.pot
This commit is contained in:
david
2020-12-11 16:38:12 +01:00
committed by Kiril Vangelovski
parent fa689dab7d
commit c5f387038b
10 changed files with 63 additions and 4 deletions

View File

@@ -22,3 +22,17 @@ 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 in v14 if it's fixed
customer_global_discount_ids_readonly = fields.Many2many(
string="Sale Global Discounts (readonly)",
related="customer_global_discount_ids",
readonly=True,
)
supplier_global_discount_ids_readonly = fields.Many2many(
string="Purchase Global Discounts (readonly)",
related="supplier_global_discount_ids",
readonly=True,
)