Skip to content

[19.0][ADD] sale_order_priority_partner - #4537

Open
PaoloYam wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-add-sale_order_priority_partner
Open

[19.0][ADD] sale_order_priority_partner#4537
PaoloYam wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-add-sale_order_priority_partner

Conversation

@PaoloYam

Copy link
Copy Markdown

Add sale_priority selection field on res.partner
use this field as default at sale.order creation

@OCA-git-bot OCA-git-bot added series:19.0 mod:sale_order_priority_partner Module sale_order_priority_partner labels Aug 20, 2026
Comment thread sale_order_priority_partner/__init__.py Outdated
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner_urgent = cls.env["res.partner"].create(

@Ricardoalso Ricardoalso Aug 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
cls.partner_urgent = cls.env["res.partner"].create(
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.partner_urgent = cls.env["res.partner"].create(

missing cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

@Ricardoalso Ricardoalso left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small comments,

LG otherwise

def create(self, vals_list):
# override to use partner_id.sale_priority as default priority if set
for vals in vals_list:
partner = self.env["res.partner"].browse(vals.get("partner_id"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
partner = self.env["res.partner"].browse(vals.get("partner_id"))
partner_id = vals.get("partner_id") or self.env.context.get(
"default_partner_id"
)
partner = self.env["res.partner"].browse(partner_id)

If a caller creates an order relying on default_partner_id in context (quick-create/wizard flows)

Add sale_priority selection field on res.partner
use this field as default at sale.order creation
@PaoloYam
PaoloYam force-pushed the 19.0-add-sale_order_priority_partner branch from dbd6220 to b8f2b9f Compare August 21, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sale_order_priority_partner Module sale_order_priority_partner series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants