Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sale_partner_address_restrict issues/ideas #1836

Open
gdgellatly opened this issue Aug 28, 2024 · 1 comment
Open

sale_partner_address_restrict issues/ideas #1836

gdgellatly opened this issue Aug 28, 2024 · 1 comment

Comments

@gdgellatly
Copy link
Contributor

gdgellatly commented Aug 28, 2024

Is your feature request related to a problem?
If so, please provide clear and concise description of what the problem is.
The primary issue is that this module relies on the partner being a commercial partner. However if dealing with a large company with many buyers, often you will use the contact rather than the parent.

The second issue is I don't see why this module is in partner-contact when for example sale_commercial_partner is in sale-workflow but just a minor detail.

Describe the solution you'd like
For me there are 2 solutions

  1. Simply change the domain in the onchange to self.partner_id.commercial_partner_id.id . This has the downside of continuing to use deprecated functionality.
  2. Depend on sale_commercial_partner, and use a domain set on the field declaration. e.g. fields.Many2one(..., domain="[('commercial_partner_id', '=', commercial_partner_id)]", check_company=True) or alternately adding '|', ('company_id', '=', False), ('company_id', '=', company_id)] to the domain. The downside is no inheritance, possible overwrites etc but benefit of removing onchange and deprecated domain return.

Of course 1 and 2 could be combined. Notwithstanding technical considerations, extensions, etc, the functional consequence to people who only use commercial partners on sales is nil in either option, but greatly increases usability for those that use contacts.

Additional context
Honestly, I don't know. I was just looking for something and stumbled on this while browsing and thought it was a good idea but saw that it just wouldn't quite fit any client I have for reasons above. I'm happy to do here if agreement, or just write my own thing.

@gdgellatly
Copy link
Contributor Author

    partner_shipping_id = fields.Many2one(
        domain="[('commercial_partner_id', '=', commercial_partner_id)]",
        check_company=True
    )
    partner_invoice_id = fields.Many2one(
        domain="[('commercial_partner_id', '=', commercial_partner_id)]",
        check_company=True
    )

Depending on sale_commercial_partner seems functionally equivalent to this module excluding the constraint check on commercial partner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant