Skip to content

Commit

Permalink
Merge PR #474 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Jul 5, 2024
2 parents 0515b99 + 7ed50ef commit cb4f1c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion ddmrp/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _find_buffer_link(self):
move_model = self.env["stock.move"]
for rec in self.filtered(lambda r: not r.buffer_ids):
mto_move = move_model.search(
[("created_purchase_line_id", "=", rec.id)], limit=1
[("created_purchase_line_ids", "in", rec.id)], limit=1
)
if mto_move:
# MTO lines are not accounted in MTS stock buffers.
Expand Down
2 changes: 0 additions & 2 deletions ddmrp/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class StockMove(models.Model):
comodel_name="stock.buffer",
string="Linked Stock Buffers",
)
# Add an index as '_find_buffer_link' method is using it as search criteria
created_purchase_line_id = fields.Many2one(index=True)

def _prepare_procurement_values(self):
res = super()._prepare_procurement_values()
Expand Down

0 comments on commit cb4f1c6

Please sign in to comment.