Skip to content

Commit

Permalink
[16.0][ADD] stock_picking_date_done: stock picking custom date in sto…
Browse files Browse the repository at this point in the history
…ck move line date.
  • Loading branch information
alfredoavanzosc committed Jan 16, 2025
1 parent 39ea439 commit f5dfb74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
1 change: 0 additions & 1 deletion stock_picking_date_done/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from . import stock_picking
from . import stock_move
from . import stock_move_line
17 changes: 0 additions & 17 deletions stock_picking_date_done/models/stock_move_line.py

This file was deleted.

14 changes: 4 additions & 10 deletions stock_picking_date_done/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ def button_validate(self):
pickings_custom_date_done_null.write(
{"custom_date_done": fields.Datetime.now()}
)
return super().button_validate()

def write(self, vals):
result = super().write(vals)
if "custom_date_done" in vals:
for line in self:
for move in line.move_ids_without_package:
move.date = line.custom_date_done
for move_line in line.move_line_ids_without_package:
move_line.date = line.custom_date_done
result = super().button_validate()
for picking in self:
picking.move_ids.write({"date": picking.custom_date_done })
picking.move_line_ids.write({"date": picking.custom_date_done })
return result

0 comments on commit f5dfb74

Please sign in to comment.