Skip to content

Commit

Permalink
[18.0][MIG] stock_no_negative: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BertVGroenendael committed Oct 23, 2024
1 parent ee5cb46 commit 2a8a5ff
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions stock_no_negative/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ Contributors

- Foram Darji <[email protected]>

- `Dynapps <https://www.dynapps.eu/>`__:

- Bert Van Groenendael <[email protected]>

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

Expand Down
2 changes: 1 addition & 1 deletion stock_no_negative/models/stock_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def check_negative_qty(self):
disallowed_by_location = not quant.location_id.allow_negative_stock
if (
float_compare(quant.quantity, 0, precision_digits=p) == -1
and quant.product_id.type == "product"
and quant.product_id.is_storable
and quant.location_id.usage in ["internal", "transit"]
and disallowed_by_product
and disallowed_by_location
Expand Down
3 changes: 3 additions & 0 deletions stock_no_negative/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@

- [OERP Canada](https://www.oerp.ca/):
- Foram Darji \<<[email protected]>\>

- [Dynapps](https://www.dynapps.eu/):
- Bert Van Groenendael \<<[email protected]>\>
4 changes: 4 additions & 0 deletions stock_no_negative/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ <h2><a class="toc-backref" href="#toc-entry-12">Contributors</a></h2>
<li>Foram Darji &lt;<a class="reference external" href="mailto:fd&#64;oerp.ca">fd&#64;oerp.ca</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.dynapps.eu/">Dynapps</a>:<ul>
<li>Bert Van Groenendael &lt;<a class="reference external" href="mailto:bert.vangroenendael&#64;dynapps.eu">bert.vangroenendael&#64;dynapps.eu</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
6 changes: 4 additions & 2 deletions stock_no_negative/tests/test_stock_no_negative.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def _create_product(self, name):
{
"name": name,
"categ_id": self.product_ctg.id,
"type": "product",
"is_storable": True,
"type": "consu",
"allow_negative_stock": False,
}
)
Expand All @@ -52,7 +53,8 @@ def _create_product_with_lot(self, name):
{
"name": name,
"categ_id": self.product_ctg.id,
"type": "product",
"is_storable": True,
"type": "consu",
"tracking": "lot",
"allow_negative_stock": False,
}
Expand Down

0 comments on commit 2a8a5ff

Please sign in to comment.