Skip to content

Commit

Permalink
[MIG] base_global_discount: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-S73 committed Mar 15, 2024
1 parent 89d4685 commit 5be6ea5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion base_global_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Base Global Discount",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Base",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-backend",
Expand Down
4 changes: 2 additions & 2 deletions base_global_discount/models/global_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class GlobalDiscount(models.Model):
default=lambda self: self.env.company,
)

def name_get(self):
def _compute_display_name(self):
result = []
for one in self:
result.append((one.id, f"{one.name} ({one.discount:.2f}%)"))
one.display_name = f"{one.name} ({one.discount:.2f}%)"
return result

def _get_global_discount_vals(self, base, **kwargs):
Expand Down
8 changes: 4 additions & 4 deletions base_global_discount/views/res_partner_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
name="customer_global_discount_ids"
widget="many2many_tags"
groups="base_global_discount.group_global_discount"
attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}"
invisible="not is_company and parent_id"
/>
<field
name="customer_global_discount_ids"
string="Sale Global Discounts"
widget="many2many_tags"
groups="!base_global_discount.group_global_discount"
attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}"
invisible="not is_company and parent_id"
readonly="1"
/>
</group>
Expand All @@ -27,15 +27,15 @@
name="supplier_global_discount_ids"
widget="many2many_tags"
groups="base_global_discount.group_global_discount"
attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}"
invisible="not is_company and parent_id"
/>
<field
name="supplier_global_discount_ids"
string="Purchase Global Discounts"
readonly="1"
widget="many2many_tags"
groups="!base_global_discount.group_global_discount"
attrs="{'invisible': [('is_company', '=', False), ('parent_id', '!=', False)]}"
invisible="not is_company and parent_id"
/>
</group>
</field>
Expand Down

0 comments on commit 5be6ea5

Please sign in to comment.