Skip to content

Commit 8c5341e

Browse files
committed
[FIX] website_sale: inherit website salesperson domain in settings
Versions -------- - saas-17.4+ Steps ----- 1. Go to Website / Settings; 2. scroll to Shop - Checkout Process; 3. assign portal user as salesperson for online orders. Issue ----- Portal user shouldn't be allowed as a salesperson. Cause ----- The `salesperson_id` field of `res.config.settings` is set to be related to `website_id.salesperson_id`. The `salesperson_id` field for `website` does have a domain configured, but because the domain is a string, it does not get re-used for related fields[^1]. [^1]: https://github.com/odoo/odoo/blob/87381d316/odoo/fields.py#L3009-L3021 Solution -------- Provide the domain as a list. opw-4801697 closes odoo#210612 Signed-off-by: Levi Siuzdak <sile@odoo.com>
1 parent fbe6f2a commit 8c5341e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/website_sale/models/website.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def _default_recovery_mail_template(self):
2828

2929
enabled_portal_reorder_button = fields.Boolean(string="Re-order From Portal")
3030
salesperson_id = fields.Many2one(
31-
string="Salesperson", comodel_name='res.users', domain="[('share', '=', False)]",
31+
string="Salesperson",
32+
comodel_name='res.users',
33+
domain=[('share', '=', False)],
3234
)
3335
salesteam_id = fields.Many2one(
3436
string="Sales Team",

0 commit comments

Comments
 (0)