-
-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by dreispt
- Loading branch information
Showing
8 changed files
with
143 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
from . import product | ||
from . import res_config_settings | ||
from . import stock_lot | ||
from . import stock_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
def action_show_details(self): | ||
"""Avoid calling and incrementing the sequence if not needed or already done""" | ||
seq_policy = self.env["stock.lot"]._get_sequence_policy() | ||
if seq_policy in ("product", "global"): | ||
# If move is not supposed to assign serial pass empty string for next serial | ||
if not self.display_assign_serial: | ||
self = self.with_context(force_next_serial="") | ||
# If the sequence was already called once, avoid calling it another time | ||
elif self.next_serial: | ||
self = self.with_context(force_next_serial=self.next_serial) | ||
return super(StockMove, self).action_show_details() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
* Adria Gil Sorribes <adria.gil@forgeflow.com> | ||
* Domantas Girdžiūnas <domantas@vialaurea.lt> | ||
* Akim Juillerat <akim.juillerat@camptocamp.com> | ||
|
||
* `Camptocamp <https://www.camptocamp.com>`__: | ||
|
||
* Akim Juillerat <akim.juillerat@camptocamp.com> | ||
* Vincent Van Rossem <vincent.vanrossem@camptocamp.com> | ||
|
||
* `Quartile <https://www.quartile.co>`__: | ||
|
||
* Yoshi Tashiro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* There is an issue with the use of ir.sequence with the newer version of Odoo. | ||
|
||
Mostly, when opening the detailed operations of an assigned picking for a product | ||
tracked by serial numbers, Odoo systematically calls `_get_next_serial` even | ||
if there is not any serial number to generate. | ||
Moreover, the widget allowing to generate the serial numbers will not call | ||
the sequence but only increment the number according to the next serial, | ||
potentially leading to a sequence that is not in sync anymore with the created | ||
serial numbers. | ||
|
||
cf https://github.com/OCA/product-attribute/issues/1326 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters