[IMP] scrap_reason_code: pre-commit auto fixes

This commit is contained in:
John Herholz
2023-12-21 11:06:01 +01:00
parent 783dd8346e
commit 1204b07b25
13 changed files with 72 additions and 59 deletions

View File

@@ -17,19 +17,19 @@ Scrap Reason Code
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/scrap_reason_code :target: https://github.com/OCA/stock-logistics-warehouse/tree/17.0/scrap_reason_code
:alt: OCA/stock-logistics-warehouse :alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-scrap_reason_code :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-17-0/stock-logistics-warehouse-17-0-scrap_reason_code
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=16.0 :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=17.0
:alt: Try me on Runboat :alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
Adds a reason code for scrapping operations and an interface for the user Adds a reason code for scrapping operations and an interface for the
to create scrap codes user to create scrap codes
**Table of contents** **Table of contents**
@@ -46,10 +46,15 @@ Create a required scrap reason code and provide scrap location.
Usage Usage
===== =====
- Go to Inventory > Operations > Scrap - Go to Inventory > Operations > Scrap
- Create a scarp order and select reason code. - Create a scarp order and select reason code.
- A scrap location will be readonly and auto fill based on selected reason - A scrap location will be readonly and auto fill based on selected
code. reason code.
Known issues / Roadmap
======================
Bug Tracker Bug Tracker
=========== ===========
@@ -57,7 +62,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_. 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. 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 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:%20scrap_reason_code%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20scrap_reason_code%0Aversion:%2017.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. Do not contact contributors directly about support or help with technical issues.
@@ -65,30 +70,30 @@ Credits
======= =======
Authors Authors
~~~~~~~ -------
* Open Source Integrators * Open Source Integrators
Contributors Contributors
~~~~~~~~~~~~ ------------
* Michael Allen <mallen@opensourceintegrators.com> - Michael Allen <mallen@opensourceintegrators.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com> - Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Balaji Kannan <bkannan@opensourceintegrators.com> - Balaji Kannan <bkannan@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> - Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Chandresh Thakkar <cthakkar@opensourceintegrators.com> - Chandresh Thakkar <cthakkar@opensourceintegrators.com>
* Hughes Damry <hughes.damry@acsone.eu> - Hughes Damry <hughes.damry@acsone.eu>
* Lois Rilo <lois.rilo@forgeflow.com> - Lois Rilo <lois.rilo@forgeflow.com>
Other credits Other credits
~~~~~~~~~~~~~ -------------
The development of this module has been financially supported by: The development of this module has been financially supported by:
* Open Source Integrators - Open Source Integrators
Maintainers Maintainers
~~~~~~~~~~~ -----------
This module is maintained by the OCA. This module is maintained by the OCA.
@@ -108,6 +113,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-bodedra| |maintainer-bodedra|
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/scrap_reason_code>`_ project on GitHub. This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/17.0/scrap_reason_code>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -49,7 +49,7 @@ class StockScrap(models.Model):
) )
def _prepare_move_values(self): def _prepare_move_values(self):
res = super(StockScrap, self)._prepare_move_values() res = super()._prepare_move_values()
res["reason_code_id"] = self.reason_code_id.id res["reason_code_id"] = self.reason_code_id.id
return res return res
@@ -70,7 +70,7 @@ class StockScrap(models.Model):
def write(self, vals): def write(self, vals):
self._update_scrap_reason_code_location(vals) self._update_scrap_reason_code_location(vals)
return super(StockScrap, self).write(vals) return super().write(vals)
@api.model_create_multi @api.model_create_multi
def create(self, vals_list): def create(self, vals_list):

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -1,3 +1,3 @@
Go to Inventory > Configuration > Scrap Reason Codes Go to Inventory \> Configuration \> Scrap Reason Codes
Create a required scrap reason code and provide scrap location. Create a required scrap reason code and provide scrap location.

View File

@@ -0,0 +1,7 @@
- Michael Allen \<<mallen@opensourceintegrators.com>\>
- Bhavesh Odedra \<<bodedra@opensourceintegrators.com>\>
- Balaji Kannan \<<bkannan@opensourceintegrators.com>\>
- Serpent Consulting Services Pvt. Ltd. \<<support@serpentcs.com>\>
- Chandresh Thakkar \<<cthakkar@opensourceintegrators.com>\>
- Hughes Damry \<<hughes.damry@acsone.eu>\>
- Lois Rilo \<<lois.rilo@forgeflow.com>\>

View File

@@ -1,7 +0,0 @@
* Michael Allen <mallen@opensourceintegrators.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Balaji Kannan <bkannan@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Chandresh Thakkar <cthakkar@opensourceintegrators.com>
* Hughes Damry <hughes.damry@acsone.eu>
* Lois Rilo <lois.rilo@forgeflow.com>

View File

@@ -1,3 +1,3 @@
The development of this module has been financially supported by: The development of this module has been financially supported by:
* Open Source Integrators - Open Source Integrators

View File

@@ -1,2 +1,2 @@
Adds a reason code for scrapping operations and an interface for the user Adds a reason code for scrapping operations and an interface for the
to create scrap codes user to create scrap codes

View File

@@ -0,0 +1 @@

View File

@@ -1,4 +1,4 @@
- Go to Inventory > Operations > Scrap - Go to Inventory \> Operations \> Scrap
- Create a scarp order and select reason code. - Create a scarp order and select reason code.
- A scrap location will be readonly and auto fill based on selected reason - A scrap location will be readonly and auto fill based on selected
code. reason code.

View File

@@ -369,20 +369,21 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2689e0bf5ae11316d48b7c179a2662765f9f8f553b04c3edb4612711a6338a39 !! source digest: sha256:2689e0bf5ae11316d48b7c179a2662765f9f8f553b04c3edb4612711a6338a39
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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-warehouse/tree/16.0/scrap_reason_code"><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 image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-scrap_reason_code"><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-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 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-warehouse/tree/17.0/scrap_reason_code"><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 image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-17-0/stock-logistics-warehouse-17-0-scrap_reason_code"><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-warehouse&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Adds a reason code for scrapping operations and an interface for the user <p>Adds a reason code for scrapping operations and an interface for the
to create scrap codes</p> user to create scrap codes</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li> <li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li> <li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li> <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul> <li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li> <li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li> <li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-7">Other credits</a></li> <li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li> <li><a class="reference internal" href="#other-credits" id="toc-entry-8">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@@ -397,28 +398,31 @@ to create scrap codes</p>
<ul class="simple"> <ul class="simple">
<li>Go to Inventory &gt; Operations &gt; Scrap</li> <li>Go to Inventory &gt; Operations &gt; Scrap</li>
<li>Create a scarp order and select reason code.</li> <li>Create a scarp order and select reason code.</li>
<li>A scrap location will be readonly and auto fill based on selected reason <li>A scrap location will be readonly and auto fill based on selected
code.</li> reason code.</li>
</ul> </ul>
</div> </div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
</div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#toc-entry-4">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>. <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. 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 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:%20scrap_reason_code%0Aversion:%2016.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-warehouse/issues/new?body=module:%20scrap_reason_code%0Aversion:%2017.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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1> <h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2> <h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Open Source Integrators</li> <li>Open Source Integrators</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2> <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Michael Allen &lt;<a class="reference external" href="mailto:mallen&#64;opensourceintegrators.com">mallen&#64;opensourceintegrators.com</a>&gt;</li> <li>Michael Allen &lt;<a class="reference external" href="mailto:mallen&#64;opensourceintegrators.com">mallen&#64;opensourceintegrators.com</a>&gt;</li>
<li>Bhavesh Odedra &lt;<a class="reference external" href="mailto:bodedra&#64;opensourceintegrators.com">bodedra&#64;opensourceintegrators.com</a>&gt;</li> <li>Bhavesh Odedra &lt;<a class="reference external" href="mailto:bodedra&#64;opensourceintegrators.com">bodedra&#64;opensourceintegrators.com</a>&gt;</li>
@@ -430,14 +434,14 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="other-credits"> <div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2> <h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
<p>The development of this module has been financially supported by:</p> <p>The development of this module has been financially supported by:</p>
<ul class="simple"> <ul class="simple">
<li>Open Source Integrators</li> <li>Open Source Integrators</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2> <h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
@@ -445,7 +449,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/bodedra"><img alt="bodedra" src="https://github.com/bodedra.png?size=40px" /></a></p> <p><a class="reference external image-reference" href="https://github.com/bodedra"><img alt="bodedra" src="https://github.com/bodedra.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/scrap_reason_code">OCA/stock-logistics-warehouse</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/17.0/scrap_reason_code">OCA/stock-logistics-warehouse</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> <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>
</div> </div>

View File

@@ -9,7 +9,7 @@ from odoo.tests.common import TransactionCase
class StockScrap(TransactionCase): class StockScrap(TransactionCase):
def setUp(self): def setUp(self):
super(StockScrap, self).setUp() super().setUp()
self.stock_location = self.env.ref("stock.stock_location_stock") self.stock_location = self.env.ref("stock.stock_location_stock")
self.customer_location = self.env.ref("stock.stock_location_customers") self.customer_location = self.env.ref("stock.stock_location_customers")