Skip to content

Commit

Permalink
[MIG] stock_picking_mass_action: Continue migration to v16
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandez-tecnativa committed Nov 13, 2023
1 parent 011ea5c commit 7a0a48e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 45 deletions.
13 changes: 7 additions & 6 deletions stock_picking_mass_action/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Picking Mass Action
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:479c7779260791788dac894277567def0e1e3307d0939ae28f702079d62d0c27
!! source digest: sha256:b57b3cafa5f50bc5967e3ef6148a19d0efd2c7dd1e89d2359df5db9953f04f41
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -22,10 +22,9 @@ Stock Picking Mass Action
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_mass_action
:alt: Translate me on Weblate

.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/154/16.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Expand Down Expand Up @@ -66,7 +65,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_mass_action%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_mass_action%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -89,6 +88,8 @@ Contributors
* Vicent Cubells
* Carlos Dauden
* Sergio Teruel
* Carolina Fernandez
* Pau Sanchez ([email protected])

Maintainers
~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions stock_picking_mass_action/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
* Vicent Cubells
* Carlos Dauden
* Sergio Teruel
* Carolina Fernandez
* Pau Sanchez ([email protected])
12 changes: 7 additions & 5 deletions stock_picking_mass_action/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Stock Picking Mass Action</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:479c7779260791788dac894277567def0e1e3307d0939ae28f702079d62d0c27
!! source digest: sha256:b57b3cafa5f50bc5967e3ef6148a19d0efd2c7dd1e89d2359df5db9953f04f41
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_mass_action"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_mass_action"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_mass_action"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_mass_action"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Facilities to check the availability of stock picking list:</p>
<ul>
<li><p class="first">A wizard which allows on multiple stock pickings at a time to:</p>
Expand Down Expand Up @@ -413,7 +413,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_mass_action%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_mass_action%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -434,7 +434,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:
* Vicent Cubells
* Carlos Dauden
* Sergio Teruel</li>
* Sergio Teruel
* Carolina Fernandez</li>
<li>Pau Sanchez (<a class="reference external" href="mailto:pau.sanchez&#64;qubiq.es">pau.sanchez&#64;qubiq.es</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -444,7 +446,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_mass_action">OCA/stock-logistics-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_mass_action">OCA/stock-logistics-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
7 changes: 0 additions & 7 deletions stock_picking_mass_action/tests/test_mass_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ def test_mass_action(self):
wiz_confirm.confirm = True
wiz_confirm.mass_action()
self.assertEqual(self.picking.state, "confirmed")
# We test checking availability
wiz_check = wiz.with_context(check_availability=True).create(
{"picking_ids": [(4, self.picking.id)]}
)
wiz_check.confirm = True
wiz_check.mass_action()
self.assertEqual(self.picking.state, "assigned")
# We test transferring picking
wiz_tranfer = wiz.with_context(transfer=True).create(
{"picking_ids": [(4, self.picking.id)]}
Expand Down
16 changes: 0 additions & 16 deletions stock_picking_mass_action/wizard/mass_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ class StockPickingMassAction(TransientModel):
_name = "stock.picking.mass.action"
_description = "Stock Picking Mass Action"

@api.model
def _default_check_availability(self):
return self.env.context.get("check_availability", False)

@api.model
def _default_transfer(self):
return self.env.context.get("transfer", False)
Expand All @@ -27,11 +23,6 @@ def _default_picking_ids(self):
default=True,
help="check this box if you want to mark as Todo the" " selected Pickings.",
)
check_availability = fields.Boolean(
default=lambda self: self._default_check_availability(),
help="check this box if you want to check the availability of"
" the selected Pickings.",
)
transfer = fields.Boolean(
default=lambda self: self._default_transfer(),
help="check this box if you want to transfer all the selected"
Expand All @@ -56,13 +47,6 @@ def mass_action(self):
).sorted(key=lambda r: r.scheduled_date)
draft_picking_lst.action_confirm()

# check availability if asked
if self.check_availability:
pickings_to_check = self.picking_ids.filtered(
lambda x: x.state not in ["draft", "cancel", "done"]
).sorted(key=lambda r: r.scheduled_date)
pickings_to_check.action_assign()

# Get all pickings ready to transfer and transfer them if asked
if self.transfer:
assigned_picking_lst = self.picking_ids.filtered(
Expand Down
12 changes: 1 addition & 11 deletions stock_picking_mass_action/wizard/mass_action_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<form string="Mass Action for the selected stock picking">
<group>
<field name="confirm" />
<field name="check_availability" />
<field name="transfer" />
</group>
<footer>
Expand All @@ -30,22 +29,13 @@
<field name="target">new</field>
<field name="binding_model_id" ref="stock.model_stock_picking" />
</record>
<!-- Check Availability Action -->
<record id="action_check_availability" model="ir.actions.act_window">
<field name="name">Check Availability</field>
<field name="res_model">stock.picking.mass.action</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'check_availability': 1}</field>
<field name="binding_model_id" ref="stock.model_stock_picking" />
</record>
<!-- Transfer Action -->
<record id="action_transfer" model="ir.actions.act_window">
<field name="name">Transfer</field>
<field name="res_model">stock.picking.mass.action</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'check_availability': 1, 'transfer': 1,}</field>
<field name="context">{'transfer': 1}</field>
<field name="binding_model_id" ref="stock.model_stock_picking" />
</record>
</odoo>

0 comments on commit 7a0a48e

Please sign in to comment.