Skip to content

Commit 9250827

Browse files
committed
[T-9524][ADD] sy_stock_picking_responsible_autoassign
1 parent 8463c60 commit 9250827

17 files changed

Lines changed: 778 additions & 0 deletions
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
====================================
6+
Stock Picking Responsible Autoassign
7+
====================================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:a26710c90a02ed0f99c26077a79c79a76c22e517a92118be7679b8a51832f700
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
22+
:alt: License: AGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-sygel--technology%2Fsy--stock--logistics--workflow-lightgray.png?logo=github
24+
:target: https://github.com/sygel-technology/sy-stock-logistics-workflow/tree/17.0/sy_stock_picking_responsible_autoassign
25+
:alt: sygel-technology/sy-stock-logistics-workflow
26+
27+
|badge1| |badge2| |badge3|
28+
29+
When enabled, the user validating the picking is automatically set as
30+
responsible if no responsible is defined.
31+
32+
**Table of contents**
33+
34+
.. contents::
35+
:local:
36+
37+
Usage
38+
=====
39+
40+
To use this module:
41+
42+
1. Go to Inventory > Configuration > Operation Types.
43+
2. Open the desired operation type.
44+
3. Enable the option "Assign Responsible on Validation".
45+
4. Validate a picking of this type without a responsible user.
46+
47+
The user performing the validation will be automatically set as
48+
responsible if none is defined.
49+
50+
Note: If a responsible is already set on the picking, it will not be
51+
overwritten.
52+
53+
Bug Tracker
54+
===========
55+
56+
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-stock-logistics-workflow/issues>`_.
57+
In case of trouble, please check there if your issue has already been reported.
58+
If you spotted it first, help us to smash it by providing a detailed and welcomed
59+
`feedback <https://github.com/sygel-technology/sy-stock-logistics-workflow/issues/new?body=module:%20sy_stock_picking_responsible_autoassign%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
60+
61+
Do not contact contributors directly about support or help with technical issues.
62+
63+
Credits
64+
=======
65+
66+
Authors
67+
-------
68+
69+
* Sygel
70+
71+
Contributors
72+
------------
73+
74+
- `Sygel <https://www.sygel.es>`__:
75+
76+
- Ángel Rivas
77+
- Valentin Vinagre
78+
- Harald Panten
79+
80+
Maintainers
81+
-----------
82+
83+
This module is part of the `sygel-technology/sy-stock-logistics-workflow <https://github.com/sygel-technology/sy-stock-logistics-workflow/tree/17.0/sy_stock_picking_responsible_autoassign>`_ project on GitHub.
84+
85+
You are welcome to contribute.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import models
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2026 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Stock Picking Responsible Autoassign",
6+
"summary": "Assign the validating user as responsible on picking validation",
7+
"version": "17.0.1.0.0",
8+
"category": "Inventory",
9+
"author": "Sygel",
10+
"website": "https://github.com/sygel-technology/sy-stock-logistics-workflow",
11+
"license": "AGPL-3",
12+
"installable": True,
13+
"application": False,
14+
"depends": ["stock"],
15+
"data": [
16+
"views/stock_picking_type_views.xml",
17+
],
18+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sy_stock_picking_responsible_autoassign
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2026-04-22 14:03+0000\n"
10+
"PO-Revision-Date: 2026-04-22 16:06+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: ca_ES\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"X-Generator: Poedit 3.9\n"
19+
20+
#. module: sy_stock_picking_responsible_autoassign
21+
#: model:ir.model.fields,field_description:sy_stock_picking_responsible_autoassign.field_stock_picking_type__assign_responsible_on_validate
22+
msgid "Assign Responsible on Validation"
23+
msgstr "Assignar responsable en la validació"
24+
25+
#. module: sy_stock_picking_responsible_autoassign
26+
#: model:ir.model.fields,help:sy_stock_picking_responsible_autoassign.field_stock_picking_type__assign_responsible_on_validate
27+
msgid ""
28+
"If enabled, the user validating the picking will be set as responsible if "
29+
"none is defined."
30+
msgstr ""
31+
"Si està activat, l’usuari que valida l’albarà s’assignarà com a "
32+
"responsable si no n’hi ha cap de definit."
33+
34+
#. module: sy_stock_picking_responsible_autoassign
35+
#: model:ir.model,name:sy_stock_picking_responsible_autoassign.model_stock_picking_type
36+
msgid "Picking Type"
37+
msgstr "Tipus de picking"
38+
39+
#. module: sy_stock_picking_responsible_autoassign
40+
#: model:ir.model,name:sy_stock_picking_responsible_autoassign.model_stock_picking
41+
msgid "Transfer"
42+
msgstr "Transferència"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sy_stock_picking_responsible_autoassign
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2026-04-22 14:03+0000\n"
10+
"PO-Revision-Date: 2026-04-22 16:06+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"X-Generator: Poedit 3.9\n"
19+
20+
#. module: sy_stock_picking_responsible_autoassign
21+
#: model:ir.model.fields,field_description:sy_stock_picking_responsible_autoassign.field_stock_picking_type__assign_responsible_on_validate
22+
msgid "Assign Responsible on Validation"
23+
msgstr "Asignar responsable en la validación"
24+
25+
#. module: sy_stock_picking_responsible_autoassign
26+
#: model:ir.model.fields,help:sy_stock_picking_responsible_autoassign.field_stock_picking_type__assign_responsible_on_validate
27+
msgid ""
28+
"If enabled, the user validating the picking will be set as responsible if "
29+
"none is defined."
30+
msgstr ""
31+
"Si está activado, el usuario que valide el albarán se establecerá como "
32+
"responsable si no hay ninguno definido."
33+
34+
#. module: sy_stock_picking_responsible_autoassign
35+
#: model:ir.model,name:sy_stock_picking_responsible_autoassign.model_stock_picking_type
36+
msgid "Picking Type"
37+
msgstr "Tipo de albarán"
38+
39+
#. module: sy_stock_picking_responsible_autoassign
40+
#: model:ir.model,name:sy_stock_picking_responsible_autoassign.model_stock_picking
41+
msgid "Transfer"
42+
msgstr "Traslado"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import stock_picking
4+
from . import stock_picking_type
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2026 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class StockPicking(models.Model):
8+
_inherit = "stock.picking"
9+
10+
def button_validate(self):
11+
for picking in self:
12+
if (
13+
picking.picking_type_id.assign_responsible_on_validate
14+
and not picking.user_id
15+
):
16+
picking.user_id = self.env.user
17+
return super().button_validate()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2026 Ángel Rivas <angel.rivas@sygel.es>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class StockPickingType(models.Model):
8+
_inherit = "stock.picking.type"
9+
10+
11+
assign_responsible_on_validate = fields.Boolean(
12+
string="Assign Responsible on Validation",
13+
help=(
14+
"If enabled, the user validating the picking will be set as responsible "
15+
"if none is defined."
16+
),
17+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Sygel](https://www.sygel.es):
2+
- Ángel Rivas
3+
- Valentin Vinagre
4+
- Harald Panten

0 commit comments

Comments
 (0)