From da3456ca22f7286a685a698de488574ca42383bd Mon Sep 17 00:00:00 2001 From: Jordi Ballester Date: Sun, 31 Oct 2021 20:14:21 +0100 Subject: [PATCH] [stock_pull_list][imp] add sequence for procurement groups created from the pull list --- stock_pull_list/__manifest__.py | 1 + stock_pull_list/data/stock_pull_list_sequence_data.xml | 9 +++++++++ stock_pull_list/wizards/stock_pull_list_wizard.py | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 stock_pull_list/data/stock_pull_list_sequence_data.xml diff --git a/stock_pull_list/__manifest__.py b/stock_pull_list/__manifest__.py index 95c7e23b9..575525423 100644 --- a/stock_pull_list/__manifest__.py +++ b/stock_pull_list/__manifest__.py @@ -16,6 +16,7 @@ "data": [ "wizards/stock_pull_list_wizard.xml", "security/ir.model.access.csv", + "data/stock_pull_list_sequence_data.xml", ], "installable": True, } diff --git a/stock_pull_list/data/stock_pull_list_sequence_data.xml b/stock_pull_list/data/stock_pull_list_sequence_data.xml new file mode 100644 index 000000000..c81858846 --- /dev/null +++ b/stock_pull_list/data/stock_pull_list_sequence_data.xml @@ -0,0 +1,9 @@ + + + Stock Pull List + stock.pull.list + SPL/ + 6 + + + diff --git a/stock_pull_list/wizards/stock_pull_list_wizard.py b/stock_pull_list/wizards/stock_pull_list_wizard.py index f581f8d2c..40eb5bf87 100644 --- a/stock_pull_list/wizards/stock_pull_list_wizard.py +++ b/stock_pull_list/wizards/stock_pull_list_wizard.py @@ -238,8 +238,11 @@ class PullListWizard(models.TransientModel): return list(itertools.product(*options_list)) def _prepare_proc_group_values(self): - # TODO: use special secuence to name procurement groups of pull lists. - return {} + vals = {} + name = self.env["ir.sequence"].next_by_code("stock.pull.list") + if name: + vals["name"] = name + return vals def action_procure(self): self.ensure_one()