Skip to content

Conversation

@AungKoKoLin1997
Copy link
Contributor

Forward port of #2187

This PR adds an option to allow selecting any partner for default addresses, instead of restricting selections to child contacts.

@qrtl QT5088

@yostashiro
Copy link
Member

I'm somehow getting errors on the partner fields (partner_delivery_id, partner_invoice_id, and partner_contact_id) added by this module in runboat when all modules from the repo are installed. There seems to be no issue if just this module is installed.

image

@AungKoKoLin1997 Can you please check and see if you can tell anything?

@yostashiro
Copy link
Member

partner_delivery_domain is somehow being taken as partner_delivery_domai (the last n is dropped).

UncaughtPromiseError > EvalError
Uncaught Promise > Can not evaluate python expression: (partner_delivery_domai, ('state', '=', 'confirmed')]) Error: Name 'partner_delivery_domai' is not defined

EvalError: Can not evaluate python expression: (partner_delivery_domai, ('state', '=', 'confirmed')])
    Error: Name 'partner_delivery_domai' is not defined
    EvalError: Can not evaluate python expression: (partner_delivery_domai, ('state', '=', 'confirmed')])
    Error: Name 'partner_delivery_domai' is not defined
        at evaluateExpr (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:3114:54)
        at domain (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:7792:148)
        at Many2OneField.getDomain (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:8107:80)
        at Many2XAutocomplete.search (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:8469:116)
        at Many2XAutocomplete.loadOptionsSource (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:8472:20)
        at AutoComplete.loadOptions (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:1692:69)
        at AutoComplete.loadSources (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:1689:219)
        at AutoComplete.open (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:1685:55)
        at AutoComplete.onInputClick (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:1706:40)
        at Object.mainEventHandler (http://oca-partner-contact-17-0-pr2221-7e4f184d5cad.runboat.odoo-community.org/web/assets/37a8da3/web.assets_web.min.js:1604:77)
        ```

@AungKoKoLin1997
Copy link
Contributor Author

partner_delivery_domain is somehow being taken as partner_delivery_domai (the last n is dropped).

@yostashiro
I found the dynamic domain is not compatible with partner_stage_only_confirmed because of this approach.

elif isinstance(domain, str):
if domain in ("", "[]"):
domain = "[('state', '=', 'confirmed')]"
else:
domain = domain[:-1]
domain += ", ('state', '=', 'confirmed')]"

I tried to fix with that approach.
#2229

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 17.0-imp-partner_contact_address_default branch from 7e4f184 to d815ca6 Compare November 28, 2025 01:21
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 17.0-imp-partner_contact_address_default branch from d815ca6 to 44d6294 Compare November 28, 2025 01:22
Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review. LGTM. Although #2229 needs to be merged, it shouldn't block this one.

Copy link

@edescalona edescalona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@edescalona
Copy link

Hi @AungKoKoLin1997, great work! Just one suggestion regarding shipping addresses:
Could you add another setting that depends on or takes precedence over the current one, allowing you to display only delivery address contacts and the partner itself? The native domain includes related delivery addresses but not the partner, so perhaps this way you could limit the domain proposed in this improvement, allowing the user to decide whether to see all contacts or only the suggested domain.

Thanks

…s to display delivery addresses and partner itself
Copy link

@edescalona edescalona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants