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.

@NL66278
Copy link
Contributor

NL66278 commented Jan 13, 2026

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-2221-by-NL66278-bump-major, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 13, 2026
Signed-off-by NL66278
@OCA-git-bot
Copy link
Contributor

@NL66278 your merge command was aborted due to failed check(s), which you can inspect on this commit of 17.0-ocabot-merge-pr-2221-by-NL66278-bump-major.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@NL66278
Copy link
Contributor

NL66278 commented Jan 14, 2026

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-2221-by-NL66278-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b597b30 into OCA:17.0 Jan 14, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at dc4a370. Thanks a lot for contributing to OCA. ❤️

@AungKoKoLin1997
Copy link
Contributor Author

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?

@edescalona I was considering in what context or business operation it would be necessary to restrict selection to only delivery address contacts and the partner itself. With the existing option that allows selecting any partner, we can already choose both the delivery address contact and the partner itself—so this case is already covered. Also, with the module’s native behavior, we can already select only related delivery addresses.

If you agree, I’d like to revert my latest commit, since the existing features already cover this case. Am I missing anything?

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.

5 participants