Skip to content

Commit

Permalink
[FIX] sale_sourced_by_line: fix conflict with precompute
Browse files Browse the repository at this point in the history
Built-in filed is marked as precompute=True.
When field is marked as precomputed and readonly, Odoo will
remove it's value from create values. (See `odoo.models.BaseModel._prepare_create_values`)
Therefore, it was not possible to set `warehouse_id` in create
as it would reset to default computed warehouse.

Now, it's fixed and readonly enforced on view level.
  • Loading branch information
viktor-anikeenko-avsys committed Oct 9, 2024
1 parent b2e4686 commit f47d3f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion sale_sourced_by_line/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Sale Sourced by Line",
"summary": "Multiple warehouse source locations for Sale order",
"version": "17.0.1.0.0",
"version": "17.0.1.0.1",
"author": "Camptocamp,"
"Eficent,"
"SerpentCS,"
Expand Down
2 changes: 0 additions & 2 deletions sale_sourced_by_line/model/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class SaleOrder(models.Model):
warehouse_id = fields.Many2one(
"stock.warehouse",
string="Default Warehouse",
readonly=True,
help="If no source warehouse is selected on line, "
"this warehouse is used as default. ",
)
Expand All @@ -25,7 +24,6 @@ class SaleOrderLine(models.Model):
warehouse_id = fields.Many2one(
"stock.warehouse",
"Source Warehouse",
readonly=True,
related="",
help="If a source warehouse is selected, "
"it will be used to define the route. "
Expand Down

0 comments on commit f47d3f7

Please sign in to comment.