Skip to content

Commit

Permalink
[IMP] proc_auto_create_grp_by_product: merge moves
Browse files Browse the repository at this point in the history
Allow to merge moves having different date_deadline to pick everything
in one operation
  • Loading branch information
jbaudoux committed Sep 1, 2023
1 parent 2aabff8 commit 11e7cc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import stock_rule
from . import stock_move
from . import procurement_group
from . import product_product
17 changes: 17 additions & 0 deletions procurement_auto_create_group_by_product/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class StockMove(models.Model):
_inherit = "stock.move"

def _prepare_merge_moves_distinct_fields(self):
result = super()._prepare_merge_moves_distinct_fields()
if self.rule_id.auto_create_group_by_product:
# Allow to merge moves on a pick operation having different
# deadlines
if "date_deadline" in result:
result.remove("date_deadline")
return result

0 comments on commit 11e7cc7

Please sign in to comment.