Skip to content

Commit

Permalink
[MIG] stock_picking_start: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sowrirajan committed Oct 7, 2024
1 parent 4800033 commit 69456c8
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 33 deletions.
4 changes: 4 additions & 0 deletions stock_picking_start/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Contributors

- Laurent Mignon <laurent.mignon@acsone.eu>

- `Sodexis Team <dev@sodexis.com>`__:

- Sowrirajan <sowrirajan@sodexis.com>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion stock_picking_start/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Stock Picking Start",
"summary": """
Add button to start picking""",
"version": "16.0.1.1.1",
"version": "17.0.1.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-workflow",
Expand Down
8 changes: 4 additions & 4 deletions stock_picking_start/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
_logger = logging.getLogger(__name__)


def pre_init_hook(cr):
def pre_init_hook(env):
"""Create and initialize the started field"""
_logger.info("Create the started field")
cr.execute(
env.cr.execute(
"""
ALTER TABLE stock_picking
ADD COLUMN started boolean;
"""
)
_logger.info("Initialize the started field")
cr.execute(
env.cr.execute(
"""
UPDATE stock_picking
SET started = printed
WHERE state = 'assigned';
"""
)
_logger.info(f"{cr.rowcount} records updated")
_logger.info(f"{env.cr.rowcount} records updated")
3 changes: 3 additions & 0 deletions stock_picking_start/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
- [Sodexis Team](dev@sodexis.com):

> - Sowrirajan \<<sowrirajan@sodexis.com>\>
10 changes: 9 additions & 1 deletion stock_picking_start/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,16 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul>
<li><p class="first">Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</p>
</li>
<li><p class="first"><a class="reference external" href="mailto:dev&#64;sodexis.com">Sodexis Team</a>:</p>
<blockquote>
<ul class="simple">
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Sowrirajan &lt;<a class="reference external" href="mailto:sowrirajan&#64;sodexis.com">sowrirajan&#64;sodexis.com</a>&gt;</li>
</ul>
</blockquote>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_start/tests/test_stock_picking_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestStockPickinStart(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestStockPickinStart, cls).setUpClass()
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.wh = cls.env["stock.warehouse"].create(
{
Expand Down
35 changes: 13 additions & 22 deletions stock_picking_start/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,20 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="stock.res_config_settings_view_form" />
<field name="arch" type="xml">
<div name="operations_setting_container" position="inside">
<div class="col-12 col-lg-6 o_setting_box" id="stock_picking_start">
<div class="o_setting_left_pane">
<field name="stock_picking_assign_operator_at_start" />
</div>
<div class="o_setting_right_pane">
<label
for="stock_picking_assign_operator_at_start"
string="Assign responsible at stock picking start"
/>
<span
class="fa fa-lg"
title="Values set here are company-specific."
groups="base.group_multi_company"
/>
<div class="text-muted">
Assign responsible when the button start si pushed on the stock picking form.
<xpath
expr="//block[@name='operations_setting_container']"
position="inside"
>
<setting
title="Values set here are company-specific."
groups="base.group_multi_company"
help="Assign responsible when the button start is pushed on the stock picking form.
If set, when a picking is created no default value is provided for the responsible field on the picking form.
It will be filled with the current user when the button start on the picking form is clicked.
</div>
</div>
</div>
</div>
It will be filled with the current user when the button start on the picking form is clicked."
>
<field name="stock_picking_assign_operator_at_start" />
</setting>
</xpath>
</field>
</record>

Expand Down
8 changes: 4 additions & 4 deletions stock_picking_start/views/stock_picking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name="action_start"
string="Start"
type="object"
attrs="{'invisible': [('action_start_allowed', '!=', True)]}"
invisible='action_start_allowed != True'
class="oe_highlight"
/>
</xpath>
Expand All @@ -24,7 +24,7 @@
name="web_ribbon"
title="Started"
bg_color="bg-success"
attrs="{'invisible': [('started', '=', False)]}"
invisible='started == False'
/>
</div>
<xpath expr="//header/button[last()]" position="after">
Expand All @@ -33,7 +33,7 @@
name="action_cancel_start"
string="Cancel Start"
type="object"
attrs="{'invisible': [('action_cancel_start_allowed', '!=', True)]}"
invisible='action_cancel_start_allowed != True'
/>
</xpath>
</field>
Expand Down Expand Up @@ -63,7 +63,7 @@
<attribute name="decoration-success">started</attribute>
</tree>
<tree position="inside">
<field name="started" invisible="1" />
<field name="started" column_invisible="1" />
</tree>
</field>
</record>
Expand Down

0 comments on commit 69456c8

Please sign in to comment.