Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] stock_location_flowable: hide buttons on flowable operation #499

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stock_location_flowable/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Location Flowable
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:53b089e0074153d414bd76790674ba0bd683e87a8d33f0ed62a664e34a0dfded
!! source digest: sha256:3d931b9503a0af5135edf372e0734fd9315f8a2b5b592f4037aad7322173eef6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -50,9 +50,9 @@ Authors
Contributors
~~~~~~~~~~~~

* `NuoBiT <https://www.nuobit.com>`_:

* Frank Cespedes <fcespedes@nuobit.com>
- [NuoBiT](https://www.nuobit.com):
- Frank Cespedes <fcespedes@nuobit.com>
- Deniz Gallo <dgallo@nuobit.com>

Maintainers
~~~~~~~~~~~
Expand Down
8 changes: 7 additions & 1 deletion stock_location_flowable/models/mrp_production.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright NuoBiT Solutions - Frank Cespedes <fcespedes@nuobit.com>
# Copyright NuoBiT - Frank Cespedes <fcespedes@nuobit.com>
# Copyright 2025 NuoBiT - Deniz Gallo <dgallo@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import _, api, fields, models
Expand All @@ -10,6 +11,11 @@

picking_id = fields.Many2one(comodel_name="stock.picking")
production_blocked = fields.Boolean(compute="_compute_production_blocked")
production_flowable = fields.Boolean(compute="_compute_production_flowable")

def _compute_production_flowable(self):
for rec in self:
rec.production_flowable = rec.picking_type_id.flowable_operation

Check warning on line 18 in stock_location_flowable/models/mrp_production.py

View check run for this annotation

Codecov / codecov/patch

stock_location_flowable/models/mrp_production.py#L18

Added line #L18 was not covered by tests

def _compute_production_blocked(self):
for rec in self:
Expand Down
6 changes: 3 additions & 3 deletions stock_location_flowable/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* `NuoBiT <https://www.nuobit.com>`_:

* Frank Cespedes <fcespedes@nuobit.com>
- [NuoBiT](https://www.nuobit.com):
- Frank Cespedes <fcespedes@nuobit.com>
- Deniz Gallo <dgallo@nuobit.com>
16 changes: 8 additions & 8 deletions stock_location_flowable/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +276,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +302,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,7 +368,7 @@ <h1 class="title">Stock Location Flowable</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:53b089e0074153d414bd76790674ba0bd683e87a8d33f0ed62a664e34a0dfded
!! source digest: sha256:3d931b9503a0af5135edf372e0734fd9315f8a2b5b592f4037aad7322173eef6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/NuoBiT/odoo-addons/tree/14.0/stock_location_flowable"><img alt="NuoBiT/odoo-addons" src="https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github" /></a></p>
<ul class="simple">
Expand Down Expand Up @@ -404,10 +405,9 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.nuobit.com">NuoBiT</a>:<ul>
<li>Frank Cespedes &lt;<a class="reference external" href="mailto:fcespedes&#64;nuobit.com">fcespedes&#64;nuobit.com</a>&gt;</li>
</ul>
</li>
<li>[NuoBiT](<a class="reference external" href="https://www.nuobit.com">https://www.nuobit.com</a>):
- Frank Cespedes &lt;<a class="reference external" href="mailto:fcespedes&#64;nuobit.com">fcespedes&#64;nuobit.com</a>&gt;
- Deniz Gallo &lt;<a class="reference external" href="mailto:dgallo&#64;nuobit.com">dgallo&#64;nuobit.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
13 changes: 13 additions & 0 deletions stock_location_flowable/views/mrp_production_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
name="attrs"
>{'readonly': [('production_blocked', '=', True)]}</attribute>
</xpath>
<xpath expr="//button[@name='button_scrap']" position="before">
<field name="production_flowable" invisible="1" />
</xpath>
<xpath expr="//button[@name='button_scrap']" position="attributes">
<attribute
name="attrs"
>{'invisible': [('production_flowable', '=', True)]}</attribute>
</xpath>
<xpath expr="//button[@name='button_unbuild']" position="attributes">
<attribute
name="attrs"
>{'invisible': [('production_flowable', '=', True)]}</attribute>
</xpath>
</field>
</record>
</odoo>
Loading