- Remove redundant string= from 17 field definitions where name matches string value (W8113) - Convert @staticmethod to instance methods in selection methods for proper self.env._() access - Fix W8161 (prefer-env-translation) by using self.env._() instead of standalone _() - Fix W8301/W8115 (translation-not-lazy) by proper placement of % interpolation outside self.env._() - Remove unused imports of odoo._ from group_order.py and sale_order_extension.py - All OCA linting warnings in website_sale_aplicoop main models are now resolved Changes: - website_sale_aplicoop/models/group_order.py: 21 field definitions cleaned - website_sale_aplicoop/models/sale_order_extension.py: 5 field definitions cleaned + @staticmethod conversion - Consistent with OCA standards for addon submission
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
# Copyright 2025-Today Criptomart
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
|
|
|
from odoo import _
|
|
from odoo import fields
|
|
from odoo import models
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = "res.partner"
|
|
|
|
# Campo para identificar si un partner es un grupo
|
|
is_group = fields.Boolean(
|
|
string="Is a Consumer Group?",
|
|
help="Check this box if the partner represents a group of users",
|
|
default=False,
|
|
)
|
|
|
|
# Relación para los miembros de un grupo (si is_group es True)
|
|
member_ids = fields.Many2many(
|
|
"res.partner",
|
|
"res_partner_group_members_rel",
|
|
"group_id",
|
|
"member_id",
|
|
domain=[("is_group", "=", True)],
|
|
string="Consumer Groups",
|
|
help="Consumer Groups this partner belongs to",
|
|
)
|
|
|
|
# Inverse relation: group orders this group participates in
|
|
group_order_ids = fields.Many2many(
|
|
"group.order",
|
|
"group_order_group_rel",
|
|
"group_id",
|
|
"order_id",
|
|
string="Consumer Group Orders",
|
|
help="Group orders this consumer group participates in",
|
|
readonly=True,
|
|
)
|