Skip to content

Commit

Permalink
[FIX] stock_change_qty_reason: Fix button_box in reasion view
Browse files Browse the repository at this point in the history
Also remove past migrations, and improve comments
  • Loading branch information
paradoxxxzero committed Sep 28, 2023
1 parent 319ae1e commit e0eccf8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 95 deletions.
12 changes: 8 additions & 4 deletions stock_change_qty_reason/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
Stock Change Quantity Reason
============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3f1cfd8ad281921b4dd48e8f1f2a7f4190a8412a1300410cc540cad7a319f01f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -20,10 +23,10 @@ Stock Change Quantity Reason
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_change_qty_reason
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-warehouse&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=16.0
:alt: Try me on Runboat

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

This module extends the product stock management and allows to set a reason
in inventory adjustments globally or per line.
Expand Down Expand Up @@ -64,7 +67,7 @@ Bug Tracker

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_change_qty_reason%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 @@ -85,6 +88,7 @@ Contributors
* Andreas Dian S.P <[email protected]>
* Héctor Villarreal <[email protected]>
* Urvisha Desai <[email protected]>
* Florian Mounier <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
54 changes: 0 additions & 54 deletions stock_change_qty_reason/migrations/16.0.1.0.0/post-migration.py

This file was deleted.

25 changes: 0 additions & 25 deletions stock_change_qty_reason/migrations/16.0.1.0.0/pre-migration.py

This file was deleted.

3 changes: 2 additions & 1 deletion stock_change_qty_reason/models/stock_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def _get_inventory_fields_write(self):
return res

def _get_inventory_move_values(self, qty, location_id, location_dest_id, out=False):
"""Function to super _get_inventory_move_values"""
# Called when user manually set a new quantity (via `inventory_quantity`)
res = super()._get_inventory_move_values(
qty, location_id, location_dest_id, out
)
# Aftect the reason to the move line
context = (
self.reason if not self.preset_reason_id else self.preset_reason_id.name
)
Expand Down
1 change: 1 addition & 0 deletions stock_change_qty_reason/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
* Andreas Dian S.P <[email protected]>
* Héctor Villarreal <[email protected]>
* Urvisha Desai <[email protected]>
* Florian Mounier <[email protected]>
9 changes: 6 additions & 3 deletions stock_change_qty_reason/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,10 @@ <h1 class="title">Stock Change Quantity Reason</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3f1cfd8ad281921b4dd48e8f1f2a7f4190a8412a1300410cc540cad7a319f01f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_change_qty_reason"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_change_qty_reason"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-warehouse&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><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_change_qty_reason"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_change_qty_reason"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&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>This module extends the product stock management and allows to set a reason
in inventory adjustments globally or per line.</p>
<p>It also can manage preset reasons optionally.</p>
Expand Down Expand Up @@ -412,7 +414,7 @@ <h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1>
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/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 smashing it by providing a detailed and welcomed
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-warehouse/issues/new?body=module:%20stock_change_qty_reason%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>
Expand All @@ -431,7 +433,8 @@ <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<li>Meyomesse Gilles &lt;<a class="reference external" href="mailto:meyomesse.gilles&#64;gmail.com">meyomesse.gilles&#64;gmail.com</a>&gt;</li>
<li>Andreas Dian S.P &lt;<a class="reference external" href="mailto:andreasdian777&#64;gmail.com">andreasdian777&#64;gmail.com</a>&gt;</li>
<li>Héctor Villarreal &lt;<a class="reference external" href="mailto:hector.villarreal&#64;forgeflow.com">hector.villarreal&#64;forgeflow.com</a>&gt;</li>
<li>Urvisha Desai&lt;<a class="reference external" href="mailto:udesai&#64;opensourceintegrators.com">udesai&#64;opensourceintegrators.com</a>&gt;</li>
<li>Urvisha Desai &lt;<a class="reference external" href="mailto:udesai&#64;opensourceintegrators.com">udesai&#64;opensourceintegrators.com</a>&gt;</li>
<li>Florian Mounier &lt;<a class="reference external" href="mailto:florian.mounier&#64;akretion.com">florian.mounier&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
13 changes: 5 additions & 8 deletions stock_change_qty_reason/views/stock_quant_reason_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
<field name="model">stock.quant.reason</field>
<field name="arch" type="xml">
<form string="Preset Reason">
<header>
</header>
<sheet>
<div class="oe_button_box" name="active_button_box">
<div class="oe_button_box" name="button_box">
<button
name="toggle_active"
type="object"
class="oe_stat_button"
icon="fa-archive"
>
<field
name="active"
widget="boolean_button"
options='{"terminology": "archive"}'
/>
<span class="o_form_label">
Active
</span>
<field name="active" />
</button>
</div>
<group>
Expand Down

0 comments on commit e0eccf8

Please sign in to comment.