Initialize v18 branch

Rename *_usability modules to *_usability_akretion
This commit is contained in:
Alexis de Lattre
2024-12-24 10:11:21 +01:00
parent 9913924202
commit 13744fc404
264 changed files with 50 additions and 87 deletions

View File

@@ -0,0 +1,69 @@
=============
MRP Usability
=============
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
Small usability improvements on MRP:
* order by id desc
* show field date_start and date_finished on mrp.production form view
* show more fields on stock move form
* show bom type in tree view + add group by
* complete Manufacturing Order report with unvailable products
* improve smart button from products to BoMs (display BoM form if only one instead of displaying a list of one)
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/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
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2012.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.
Credits
=======
Authors
~~~~~~~
* Akretion
Contributors
~~~~~~~~~~~~
Alexis de Lattre <alexis.delattre@akretion.com>
Maintainers
~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability>`_ project on GitHub.
You are welcome to contribute.

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,21 @@
# Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'MRP Usability',
'version': '16.0.1.0.0',
'category': 'Manufacturing',
'license': 'AGPL-3',
'summary': 'Usability improvements on manufacturing',
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['mrp'],
'data': [
'views/mrp_production.xml',
'views/product_template.xml',
'views/stock_move.xml',
# 'report/mrp_report.xml' # TODO
],
'installable': False,
}

View File

@@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-04 16:16+0000\n"
"PO-Revision-Date: 2024-07-04 16:16+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mrp_usability
#: model_terms:ir.ui.view,arch_db:mrp_usability.mrp_production_form_view
msgid "Are you sure you want to cancel this manufacturing order?"
msgstr "Êtes-vous sur de vouloir annuler cet ordre de fabrication ?"
#. module: mrp_usability
#: model:ir.model,name:mrp_usability.model_mrp_bom
msgid "Bill of Material"
msgstr "Nomenclature"
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__type
msgid "BoM Type"
msgstr "Type de nomenclature"
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_bom__consumption
msgid ""
"Defines if you can consume more or less components than the quantity defined on the BoM:\n"
" * Allowed: allowed for all manufacturing users.\n"
" * Allowed with warning: allowed for all manufacturing users with summary of consumption differences when closing the manufacturing order.\n"
" Note that in the case of component Manual Consumption, where consumption is registered manually exclusively, consumption warnings will still be issued when appropriate also.\n"
" * Blocked: only a manager can close a manufacturing order when the BoM consumption is not respected."
msgstr ""
"Définit si vous pouvez consommer plus ou moins de composants que la quantité définie sur la nomenclature :\n"
"* Autorisé : autorisé pour tous les utilisateurs de Fabrication.\n"
"* Autorisé avec avertissement : autorisé pour tous les utilisateurs de fabrication avec récapitulatif des écarts de consommation lors de la clôture de l'ordre de fabrication.\n"
"Notez que dans le cas du composant Consommation manuelle, où la consommation est enregistrée manuellement exclusivement, des avertissements de consommation seront également émis le cas échéant.\n"
"* Bloqué : seul un responsable peut clôturer un ordre de fabrication lorsque la consommation de la nomenclature n'est pas respectée."
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_production__location_dest_id
msgid "Finished Products Location"
msgstr "Emplacement du produit fini"
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__consumption
msgid "Flexible Consumption"
msgstr "Consommation flexible"
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_bom__product_id
msgid ""
"If a product variant is defined the BOM is available only for this product."
msgstr ""
"Si une variante de produit est définie, la nomenclature n'est disponible que"
" pour ce produit."
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_production__location_dest_id
msgid "Location where the system will stock the finished products."
msgstr "Emplacement où le système stockera les produits finis."
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__ready_to_produce
msgid "Manufacturing Readiness"
msgstr "Statut de préparation de la fabrication"
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__picking_type_id
msgid "Operation Type"
msgstr "Type d'opération"
#. module: mrp_usability
#: model:ir.model,name:mrp_usability.model_product_template
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__product_tmpl_id
msgid "Product"
msgstr "Produit"
#. module: mrp_usability
#: model:ir.model,name:mrp_usability.model_product_product
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__product_id
msgid "Product Variant"
msgstr "Variante de produit"
#. module: mrp_usability
#: model:ir.model,name:mrp_usability.model_mrp_production
msgid "Production Order"
msgstr "Ordre de fabrication"
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__product_qty
msgid "Quantity"
msgstr "Quantité"
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__code
msgid "Reference"
msgstr "Référence"
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_bom__product_qty
msgid ""
"This should be the smallest quantity that this product can be produced in. "
"If the BOM contains operations, make sure the work center capacity is "
"accurate."
msgstr ""
"Il doit s'agir de la plus petite quantité dans laquelle ce produit peut être"
" produit. Si la nomenclature contient des opérations, assurez-vous que la "
"capacité du poste de travail est exacte."
#. module: mrp_usability
#: model:ir.model.fields,field_description:mrp_usability.field_mrp_bom__product_uom_id
msgid "Unit of Measure"
msgstr "Unité de mesure"
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_bom__product_uom_id
msgid ""
"Unit of Measure (Unit of Measure) is the unit of measurement for the "
"inventory control"
msgstr "L'unité de mesure est l'unité utilisée dans la gestion du stock"
#. module: mrp_usability
#: model:ir.model.fields,help:mrp_usability.field_mrp_bom__picking_type_id
msgid ""
"When a procurement has a produce route with a operation type set, it will "
"try to create a Manufacturing Order for that product using a BoM of the same"
" operation type. That allows to define stock rules which trigger different "
"manufacturing orders with different BoMs."
msgstr ""
"Quand un approvisionnement a une route 'fabriquer' avec un type d'opération "
"défini, le système essayera de créer un ordre de fabrication pour ce produit"
" en utilisant une nomenclature qui a le même type d'opération. Cela permet "
"de définir des règles de stock qui génèrent des ordres de fabrication avec "
"différentes nomenclatures."

View File

@@ -0,0 +1,3 @@
from . import mrp_production
from . import mrp_bom
from . import product

View File

@@ -0,0 +1,20 @@
# Copyright 2021-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MrpBom(models.Model):
_inherit = 'mrp.bom'
code = fields.Char(tracking=50)
type = fields.Selection(tracking=20)
product_tmpl_id = fields.Many2one(tracking=10)
product_id = fields.Many2one(tracking=15)
product_qty = fields.Float(tracking=30)
product_uom_id = fields.Many2one(tracking=35)
ready_to_produce = fields.Selection(tracking=90)
picking_type_id = fields.Many2one(tracking=60)
consumption = fields.Selection(tracking=40)

View File

@@ -0,0 +1,37 @@
# Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, Command
class MrpProduction(models.Model):
_inherit = 'mrp.production'
lot_producing_id = fields.Many2one(tracking=True)
location_src_id = fields.Many2one(tracking=True)
location_dest_id = fields.Many2one(tracking=True)
bom_id = fields.Many2one(tracking=True)
# Target: allow to modify location_dest_id until the button 'Mark as done' is pushed
# I didn't find a better implementation... feel free to improve if you find one
def _compute_move_finished_ids(self):
for prod in self:
if prod.state not in ('draft', 'done') and prod.location_dest_id:
vals = {'location_dest_id': prod.location_dest_id.id}
prod.move_finished_ids = [
Command.update(m.id, vals) for m in prod.move_finished_ids
if m.state != 'done'
]
super()._compute_move_finished_ids()
# Method used by the report, inherited in this module
# @api.model
# def get_stock_move_sold_out_report(self, move):
# lines = move.active_move_line_ids
# qty_in_lots = sum([x.product_uom_qty for x in lines])
# diff = round(move.product_qty - qty_in_lots, 3)
# if diff == 0.0:
# return ""
# return diff

View File

@@ -0,0 +1,46 @@
# Copyright 2020-2022 Akretion France (http://www.akretion.com/)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models
class ProductTemplate(models.Model):
_inherit = "product.template"
def action_view_bom(self):
"""Replace native action `template_open_bom` to distinguish if we will display
only one BoM form or a list of BoMs."""
self.ensure_one()
if self.bom_count == 1:
action_xml_id = "mrp.mrp_bom_form_action"
action = self.env["ir.actions.actions"]._for_xml_id(action_xml_id)
bom = self.env["mrp.bom"].search([("product_tmpl_id", "=", self.id)])
action.update(
{
"context": {"default_product_tmpl_id": self.id},
"views": False,
"view_mode": "form,tree",
"res_id": bom.id,
}
)
else:
action_xml_id = "mrp.template_open_bom"
action = self.env["ir.actions.actions"]._for_xml_id(action_xml_id)
return action
class ProductProduct(models.Model):
_inherit = "product.product"
def action_view_bom(self):
action = super().action_view_bom()
bom_target_ids = self.env["mrp.bom"].search(action["domain"])
if len(bom_target_ids) == 1:
action.update(
{
"views": False,
"view_mode": "form,tree",
"res_id": bom_target_ids[0].id,
}
)
return action

View File

@@ -0,0 +1,2 @@
Alexis de Lattre <alexis.delattre@akretion.com>
David Béal <david.beal@akretion.com>

View File

@@ -0,0 +1,13 @@
Small usability improvements on MRP:
* order by id desc
* show field date_start and date_finished on mrp.production form view
* show more fields on stock move form
* show bom type in tree view + add group by
* complete Manufacturing Order report with unvailable products
* improve smart button from products to BoMs (display BoM form if only one instead of displaying a list of one)

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_mrporder" inherit_id="mrp.report_mrporder">
<xpath expr="//table[1]//thead//th[1]" position="before">
<th t-if="has_serial_number">Lot</th>
</xpath>
<xpath expr="//table[1]//tbody//td[1]" position="before">
<td t-if="has_serial_number"><span t-field="ml.lot_id"/></td>
</xpath>
<xpath expr="//div[hasclass('oe_structure')][2]" position="after">
<t t-set="has_product_unavailable"
t-value="any(o.move_raw_ids.filtered(lambda x: x.product_uom_qty &gt; x.reserved_availability))"/>
<h4 if="has_product_unavailable">
These products were unavailable (or partially) while edition of this Manufacturing Order.
Here is missing quantities.
</h4>
<table class="table table-sm" t-if="o.move_raw_ids and has_product_unavailable">
<thead>
<tr>
<th>Product</th>
<th>Sold Out Quantity</th>
</tr>
</thead>
<tbody>
<t t-set="moves"
t-value="o.move_raw_ids.filtered(lambda x: x.product_uom_qty &gt; x.reserved_availability)"/>
<t t-foreach="moves" t-as="m">
<tr>
<td>
<span t-field="m.product_id"/>
</td>
<td>
<span t-esc="o.get_stock_move_sold_out_report(m)" t-if="m.state !='done'"/>
<span t-field="m.product_uom" groups="uom.group_uom"/>
</td>
</tr>
</t>
</tbody>
</table>
</xpath>
</template>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@@ -0,0 +1,419 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>MRP Usability</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* 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 }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="mrp-usability">
<h1 class="title">MRP Usability</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/akretion/odoo-usability/tree/12.0/mrp_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>Small usability improvements on MRP:</p>
<ul class="simple">
<li>order by id desc</li>
<li>show field date_start and date_finished on mrp.production form view</li>
<li>show more fields on stock move form</li>
<li>show bom type in tree view + add group by</li>
<li>complete Manufacturing Order report with unvailable products</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/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
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2012.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<p>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">usability.mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<field name="user_id" position="before">
<!-- I can't use position="move" because it would match another field in an embedded tree view -->
<field name="location_src_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}"/>
</field>
<!-- It is important to remove the original field location_dest_id
and not just set it as invisible because it cancels the changes -->
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_dest_id']" position="replace"/>
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_src_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='date_deadline']" position="after">
<field name="date_start"/>
<field name="date_finished"/>
</xpath>
<button name="action_cancel" type="object" attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" position="attributes">
<attribute name="confirm">Are you sure you want to cancel this manufacturing order?</attribute>
</button>
</field>
</record>
<record id="mrp_production_tree_view" model="ir.ui.view">
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<field name="reservation_state" position="after">
<field name="location_src_id" optional="hide" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" optional="hide" groups="stock.group_stock_multi_locations"/>
</field>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<odoo>
<record id="product_template_form_view_bom_button" model="ir.ui.view">
<field name="name">product.template.procurement</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="mrp.product_template_form_view_bom_button" />
<field name="arch" type="xml">
<xpath expr="//field[@name='bom_count']/.." position="attributes">
<attribute name="type">object</attribute>
<attribute name="name">action_view_bom</attribute>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="production_id"/>
<field name="raw_material_production_id"/>
</field>
</field>
</record>
</odoo>