mirror of
https://github.com/bringout/oca-mrp.git
synced 2026-04-24 03:32:07 +02:00
Initial commit: OCA Mrp packages (117 packages)
This commit is contained in:
commit
277e84fd7a
4403 changed files with 395154 additions and 0 deletions
44
odoo-bringout-oca-manufacture-mrp_bom_hierarchy/README.md
Normal file
44
odoo-bringout-oca-manufacture-mrp_bom_hierarchy/README.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# MRP BoM Hierarchy
|
||||
|
||||
Odoo addon: mrp_bom_hierarchy
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-manufacture-mrp_bom_hierarchy
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- mrp
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: MRP BoM Hierarchy
|
||||
- **Version**: 16.0.1.2.0
|
||||
- **Category**: Manufacturing
|
||||
- **License**: AGPL-3
|
||||
- **Installable**: True
|
||||
|
||||
## Source
|
||||
|
||||
Based on [OCA/manufacture](https://github.com/OCA/manufacture) branch 16.0, addon `mrp_bom_hierarchy`.
|
||||
|
||||
## License
|
||||
|
||||
This package maintains the original AGPL-3 license from the upstream Odoo project.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Overview: doc/OVERVIEW.md
|
||||
- Architecture: doc/ARCHITECTURE.md
|
||||
- Models: doc/MODELS.md
|
||||
- Controllers: doc/CONTROLLERS.md
|
||||
- Wizards: doc/WIZARDS.md
|
||||
- Install: doc/INSTALL.md
|
||||
- Usage: doc/USAGE.md
|
||||
- Configuration: doc/CONFIGURATION.md
|
||||
- Dependencies: doc/DEPENDENCIES.md
|
||||
- Troubleshooting: doc/TROUBLESHOOTING.md
|
||||
- FAQ: doc/FAQ.md
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Architecture
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
U[Users] -->|HTTP| V[Views and QWeb Templates]
|
||||
V --> C[Controllers]
|
||||
V --> W[Wizards – Transient Models]
|
||||
C --> M[Models and ORM]
|
||||
W --> M
|
||||
M --> R[Reports]
|
||||
DX[Data XML] --> M
|
||||
S[Security – ACLs and Groups] -. enforces .-> M
|
||||
|
||||
subgraph Mrp_bom_hierarchy Module - mrp_bom_hierarchy
|
||||
direction LR
|
||||
M:::layer
|
||||
W:::layer
|
||||
C:::layer
|
||||
V:::layer
|
||||
R:::layer
|
||||
S:::layer
|
||||
DX:::layer
|
||||
end
|
||||
|
||||
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
|
||||
```
|
||||
|
||||
Notes
|
||||
- Views include tree/form/kanban templates and report templates.
|
||||
- Controllers provide website/portal routes when present.
|
||||
- Wizards are UI flows implemented with `models.TransientModel`.
|
||||
- Data XML loads data/demo records; Security defines groups and access.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for mrp_bom_hierarchy. Configure related models, access rights, and options as needed.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [mrp](../../odoo-bringout-oca-ocb-mrp)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# FAQ
|
||||
|
||||
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
|
||||
- Q: How to enable? A: Start server with --addon mrp_bom_hierarchy or install in UI.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-manufacture-mrp_bom_hierarchy"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-manufacture-mrp_bom_hierarchy"
|
||||
```
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in mrp_bom_hierarchy.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
```
|
||||
|
||||
Notes
|
||||
- Classes show model technical names; fields omitted for brevity.
|
||||
- Items listed under _inherit are extensions of existing models.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: mrp_bom_hierarchy. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon mrp_bom_hierarchy
|
||||
- License: LGPL-3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Security
|
||||
|
||||
This module does not define custom security rules or access controls beyond Odoo defaults.
|
||||
|
||||
Default Odoo security applies:
|
||||
- Base user access through standard groups
|
||||
- Model access inherited from dependencies
|
||||
- No custom row-level security rules
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Troubleshooting
|
||||
|
||||
- Ensure Python and Odoo environment matches repo guidance.
|
||||
- Check database connectivity and logs if startup fails.
|
||||
- Validate that dependent addons listed in DEPENDENCIES.md are installed.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Usage
|
||||
|
||||
Start Odoo including this addon (from repo root):
|
||||
|
||||
```bash
|
||||
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon mrp_bom_hierarchy
|
||||
```
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Wizards
|
||||
|
||||
This module does not include UI wizards.
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
=================
|
||||
MRP BoM Hierarchy
|
||||
=================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:2b1118a157462aa9ad2a6d8327f246b786d21b4e7d142dda9bf51cbfd14e85fe
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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-OCA%2Fmanufacture-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/manufacture/tree/16.0/mrp_bom_hierarchy
|
||||
:alt: OCA/manufacture
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_bom_hierarchy
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
||||
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=16.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module extends the functionality of Bill of Materials
|
||||
to support users to better maintain the BoM hierarchy.
|
||||
|
||||
The user can navigate from the tree view to child's BoM or parent's BoM,
|
||||
or to the product's BoM components with a single click.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To use this module, you need to go to 'Manufacturing | Products | Bill of
|
||||
Materials'.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
||||
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
|
||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_bom_hierarchy%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.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* ForgeFlow
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
|
||||
* Miquel Raïch Regué <miquel.raich@forgeflow.com>
|
||||
* Quentin Dupont <quentin.dupont@grap.coop>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/16.0/mrp_bom_hierarchy>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
@ -0,0 +1 @@
|
|||
from . import model
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright 2015-22 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "MRP BoM Hierarchy",
|
||||
"summary": "Make it easy to navigate through BoM hierarchy.",
|
||||
"version": "16.0.1.2.0",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"contributors": "Grap",
|
||||
"category": "Manufacturing",
|
||||
"depends": ["mrp"],
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"license": "AGPL-3",
|
||||
"data": [
|
||||
"view/mrp_bom.xml",
|
||||
],
|
||||
"installable": True,
|
||||
"auto_install": False,
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mrp_bom_hierarchy
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \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_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom
|
||||
msgid "Bill of Material"
|
||||
msgstr "Sastavnica"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom_line
|
||||
msgid "Bill of Material Line"
|
||||
msgstr "Stavka sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Child BoMs"
|
||||
msgstr "Podređene sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__child_bom_ids
|
||||
msgid "Child Bom"
|
||||
msgstr "Podređena sastavnica"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has child BoMs"
|
||||
msgstr "Ima podređene sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_child
|
||||
msgid "Has components"
|
||||
msgstr "Ima komponente"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has parent BoMs"
|
||||
msgstr "Ima nadređene sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom_line__has_bom
|
||||
msgid "Has sub BoM"
|
||||
msgstr "Ima pod-sastavnicu"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_parent
|
||||
msgid "Is component"
|
||||
msgstr "Je komponenta"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Parent BoMs"
|
||||
msgstr "Nadređene sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__parent_bom_ids
|
||||
msgid "Parent Bom"
|
||||
msgstr "Nadređena sastavnica"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__product_has_other_bom
|
||||
msgid "Product has other BoMs"
|
||||
msgstr "Proizvod ima druge sastavnice"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "This operator is not supported"
|
||||
msgstr "Ovaj operator nije podržan"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "Value should be True or False (not %s)"
|
||||
msgstr "Vrijednost treba biti True ili False (ne %s)"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_form_view
|
||||
msgid "View product's BoM"
|
||||
msgstr "Pogledaj sastavnicu proizvoda"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "View product's other BoMs"
|
||||
msgstr "Pogledaj ostale sastavnice proizvoda"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom_line.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You should provide either a product or a product template to search a BoM "
|
||||
"Line"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mrp_bom_hierarchy
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2024-03-25 21:33+0000\n"
|
||||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.17\n"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom
|
||||
msgid "Bill of Material"
|
||||
msgstr "Lista de Material"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom_line
|
||||
msgid "Bill of Material Line"
|
||||
msgstr "Línea de Lista de Materiales"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Child BoMs"
|
||||
msgstr "LdMs Infantil"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__child_bom_ids
|
||||
msgid "Child Bom"
|
||||
msgstr "LdM Infantil"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has child BoMs"
|
||||
msgstr "Tiene LdM Infantil"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_child
|
||||
msgid "Has components"
|
||||
msgstr "Tiene componentes"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has parent BoMs"
|
||||
msgstr "Tiene LdM Parental"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom_line__has_bom
|
||||
msgid "Has sub BoM"
|
||||
msgstr "Tiene sub LdM"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_parent
|
||||
msgid "Is component"
|
||||
msgstr "Es componente"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Parent BoMs"
|
||||
msgstr "LdMs Parental"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__parent_bom_ids
|
||||
msgid "Parent Bom"
|
||||
msgstr "LdM Parental"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__product_has_other_bom
|
||||
msgid "Product has other BoMs"
|
||||
msgstr "El producto tiene otras LdMs"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "This operator is not supported"
|
||||
msgstr "Este operador no es compatible"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "Value should be True or False (not %s)"
|
||||
msgstr "El valor debe ser Verdadero o Falso (no %s)"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_form_view
|
||||
msgid "View product's BoM"
|
||||
msgstr "Ver la lista de materiales del producto"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "View product's other BoMs"
|
||||
msgstr "Ver otras listas de materiales del producto"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom_line.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You should provide either a product or a product template to search a BoM "
|
||||
"Line"
|
||||
msgstr ""
|
||||
"Debe proporcionar un producto o una plantilla de producto para buscar una "
|
||||
"línea de la lista de materiales"
|
||||
|
||||
#~ msgid "Internal Reference"
|
||||
#~ msgstr "Referencias Internas"
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mrp_bom_hierarchy
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2025-02-20 17:06+0000\n"
|
||||
"Last-Translator: ahmedtrigui <trigui43@gmail.com>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 5.6.2\n"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom
|
||||
msgid "Bill of Material"
|
||||
msgstr "Nomenclature"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom_line
|
||||
msgid "Bill of Material Line"
|
||||
msgstr "Ligne de nomenclature"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Child BoMs"
|
||||
msgstr "Enfant de nomenclature"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__child_bom_ids
|
||||
msgid "Child Bom"
|
||||
msgstr "Enfant de nomenclature"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has child BoMs"
|
||||
msgstr "A un enfant"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_child
|
||||
msgid "Has components"
|
||||
msgstr "A des composants"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has parent BoMs"
|
||||
msgstr "A une nomenclature parent"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom_line__has_bom
|
||||
msgid "Has sub BoM"
|
||||
msgstr "A une sub nomenclature"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_parent
|
||||
msgid "Is component"
|
||||
msgstr "Est composant"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Parent BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__parent_bom_ids
|
||||
msgid "Parent Bom"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__product_has_other_bom
|
||||
msgid "Product has other BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "This operator is not supported"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "Value should be True or False (not %s)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_form_view
|
||||
msgid "View product's BoM"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "View product's other BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom_line.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You should provide either a product or a product template to search a BoM "
|
||||
"Line"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mrp_bom_hierarchy
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2023-01-01 13:45+0000\n"
|
||||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.14.1\n"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom
|
||||
msgid "Bill of Material"
|
||||
msgstr "Distinta base"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom_line
|
||||
msgid "Bill of Material Line"
|
||||
msgstr "Riga distinta base"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Child BoMs"
|
||||
msgstr "DiBa figlie"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__child_bom_ids
|
||||
msgid "Child Bom"
|
||||
msgstr "DiBa figlia"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has child BoMs"
|
||||
msgstr "Ha DiBa figlie"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_child
|
||||
msgid "Has components"
|
||||
msgstr "Ha componenti"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has parent BoMs"
|
||||
msgstr "Ha DiBa padri"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom_line__has_bom
|
||||
msgid "Has sub BoM"
|
||||
msgstr "Ha sotto DiBa"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_parent
|
||||
msgid "Is component"
|
||||
msgstr "È componente"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Parent BoMs"
|
||||
msgstr "DiBa padri"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__parent_bom_ids
|
||||
msgid "Parent Bom"
|
||||
msgstr "DiBa padre"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__product_has_other_bom
|
||||
msgid "Product has other BoMs"
|
||||
msgstr "Il prodotto ha altre DiBa"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "This operator is not supported"
|
||||
msgstr "Questo operatore non è supportato"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "Value should be True or False (not %s)"
|
||||
msgstr "Il valore deve essere True o False (non %s)"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_form_view
|
||||
msgid "View product's BoM"
|
||||
msgstr "Visualizza DiBa del prodotto"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "View product's other BoMs"
|
||||
msgstr "Visualizza le altre DiBa del prodotto"
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom_line.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You should provide either a product or a product template to search a BoM "
|
||||
"Line"
|
||||
msgstr ""
|
||||
"Bisogna fornire un prodotto o un modello di prodotto per cercare una riga di "
|
||||
"DiBa"
|
||||
|
||||
#~ msgid "Internal Reference"
|
||||
#~ msgstr "Riferimento interno"
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mrp_bom_hierarchy
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \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_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom
|
||||
msgid "Bill of Material"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model,name:mrp_bom_hierarchy.model_mrp_bom_line
|
||||
msgid "Bill of Material Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Child BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__child_bom_ids
|
||||
msgid "Child Bom"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has child BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_child
|
||||
msgid "Has components"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.view_mrp_bom_filter
|
||||
msgid "Has parent BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom_line__has_bom
|
||||
msgid "Has sub BoM"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__has_parent
|
||||
msgid "Is component"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "Parent BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__parent_bom_ids
|
||||
msgid "Parent Bom"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model:ir.model.fields,field_description:mrp_bom_hierarchy.field_mrp_bom__product_has_other_bom
|
||||
msgid "Product has other BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "This operator is not supported"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom.py:0
|
||||
#, python-format
|
||||
msgid "Value should be True or False (not %s)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_form_view
|
||||
msgid "View product's BoM"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#: model_terms:ir.ui.view,arch_db:mrp_bom_hierarchy.mrp_bom_hierarchy_tree_view
|
||||
msgid "View product's other BoMs"
|
||||
msgstr ""
|
||||
|
||||
#. module: mrp_bom_hierarchy
|
||||
#. odoo-python
|
||||
#: code:addons/mrp_bom_hierarchy/model/mrp_bom_line.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You should provide either a product or a product template to search a BoM "
|
||||
"Line"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
from . import mrp_bom
|
||||
from . import mrp_bom_line
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
# Copyright 2015-22 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
import operator as py_operator
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
_inherit = "mrp.bom"
|
||||
|
||||
@api.depends("bom_line_ids.bom_id", "product_id", "product_tmpl_id")
|
||||
def _compute_product_has_other_bom(self):
|
||||
for bom in self:
|
||||
if bom.product_id:
|
||||
bom_ids = self.env["mrp.bom"].search(
|
||||
[("product_id", "=", bom.product_id.id), ("id", "!=", bom.id)],
|
||||
)
|
||||
else:
|
||||
bom_ids = self.env["mrp.bom"].search(
|
||||
[
|
||||
("product_tmpl_id", "=", bom.product_tmpl_id.id),
|
||||
("id", "!=", bom.id),
|
||||
],
|
||||
)
|
||||
if bom_ids:
|
||||
bom.product_has_other_bom = True
|
||||
else:
|
||||
bom.product_has_other_bom = False
|
||||
|
||||
@api.depends("bom_line_ids.bom_id", "product_id", "product_tmpl_id")
|
||||
def _compute_parent_bom_ids(self):
|
||||
for bom in self:
|
||||
parent_bom_line_ids = self.env["mrp.bom.line"]._bom_line_find(
|
||||
product_tmpl=bom.product_id.product_tmpl_id or bom.product_tmpl_id,
|
||||
product=bom.product_id,
|
||||
)
|
||||
if parent_bom_line_ids:
|
||||
bom.parent_bom_ids = parent_bom_line_ids.bom_id
|
||||
bom.has_parent = True
|
||||
else:
|
||||
bom.parent_bom_ids = False
|
||||
bom.has_parent = False
|
||||
|
||||
@api.depends("bom_line_ids.bom_id", "bom_line_ids.product_id")
|
||||
def _compute_child_bom_ids(self):
|
||||
for bom in self:
|
||||
bom_line_ids = bom.bom_line_ids
|
||||
bom.child_bom_ids = bom_line_ids.child_bom_id
|
||||
bom.has_child = bool(bom.child_bom_ids)
|
||||
|
||||
def _search_has_child(self, operator, value):
|
||||
if operator not in ["=", "!="]:
|
||||
raise UserError(_("This operator is not supported"))
|
||||
if value == "True":
|
||||
value = True
|
||||
elif value == "False":
|
||||
value = False
|
||||
if not isinstance(value, bool):
|
||||
raise UserError(_("Value should be True or False (not %s)") % value)
|
||||
ops = {"=": py_operator.eq, "!=": py_operator.ne}
|
||||
ids = []
|
||||
for bom in self.search([]):
|
||||
if ops[operator](value, bom.has_child):
|
||||
ids.append(bom.id)
|
||||
return [("id", "in", ids)]
|
||||
|
||||
def _search_has_parent(self, operator, value):
|
||||
if operator not in ["=", "!="]:
|
||||
raise UserError(_("This operator is not supported"))
|
||||
if value == "True":
|
||||
value = True
|
||||
elif value == "False":
|
||||
value = False
|
||||
if not isinstance(value, bool):
|
||||
raise UserError(_("Value should be True or False (not %s)") % value)
|
||||
ops = {"=": py_operator.eq, "!=": py_operator.ne}
|
||||
ids = []
|
||||
for bom in self.search([]):
|
||||
if ops[operator](value, bom.has_parent):
|
||||
ids.append(bom.id)
|
||||
return [("id", "in", ids)]
|
||||
|
||||
child_bom_ids = fields.One2many("mrp.bom", compute="_compute_child_bom_ids")
|
||||
parent_bom_ids = fields.One2many("mrp.bom", compute="_compute_parent_bom_ids")
|
||||
has_child = fields.Boolean(
|
||||
string="Has components",
|
||||
compute="_compute_child_bom_ids",
|
||||
search="_search_has_child",
|
||||
)
|
||||
has_parent = fields.Boolean(
|
||||
string="Is component",
|
||||
compute="_compute_parent_bom_ids",
|
||||
search="_search_has_parent",
|
||||
)
|
||||
product_has_other_bom = fields.Boolean(
|
||||
string="Product has other BoMs",
|
||||
compute="_compute_product_has_other_bom",
|
||||
)
|
||||
|
||||
def action_open_child_tree_view(self):
|
||||
self.ensure_one()
|
||||
res = self.env["ir.actions.actions"]._for_xml_id("mrp.mrp_bom_form_action")
|
||||
res["context"] = {"default_bom_line_ids": self.bom_line_ids.ids}
|
||||
if self.child_bom_ids:
|
||||
res["domain"] = (
|
||||
"[('id', 'in', [" + ",".join(map(str, self.child_bom_ids.ids)) + "])]"
|
||||
)
|
||||
return res
|
||||
|
||||
def action_open_parent_tree_view(self):
|
||||
self.ensure_one()
|
||||
res = self.env["ir.actions.actions"]._for_xml_id("mrp.mrp_bom_form_action")
|
||||
if self.parent_bom_ids:
|
||||
res["domain"] = (
|
||||
"[('id', 'in', [" + ",".join(map(str, self.parent_bom_ids.ids)) + "])]"
|
||||
)
|
||||
return res
|
||||
|
||||
def action_open_product_other_bom_tree_view(self):
|
||||
self.ensure_one()
|
||||
if self.product_id:
|
||||
product_bom_ids = self.env["mrp.bom"].search(
|
||||
[("product_id", "=", self.product_id.id), ("id", "!=", self.id)],
|
||||
)
|
||||
else:
|
||||
product_bom_ids = self.env["mrp.bom"].search(
|
||||
[
|
||||
("product_tmpl_id", "=", self.product_tmpl_id.id),
|
||||
("id", "!=", self.id),
|
||||
],
|
||||
)
|
||||
res = self.env["ir.actions.actions"]._for_xml_id("mrp.mrp_bom_form_action")
|
||||
if self.product_id:
|
||||
res["context"] = {
|
||||
"default_product_id": self.product_id.id,
|
||||
"default_product_tmpl_id": self.product_id.product_tmpl_id.id,
|
||||
}
|
||||
elif self.product_tmpl_id:
|
||||
res["context"] = {
|
||||
"default_product_tmpl_id": self.product_tmpl_id.id,
|
||||
}
|
||||
res["domain"] = (
|
||||
"[('id', 'in', [" + ",".join(map(str, product_bom_ids.ids)) + "])]"
|
||||
)
|
||||
return res
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
# Copyright 2015-22 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# Copyright (C) 2023 - Today: GRAP (http://www.grap.coop)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class MrpBomLine(models.Model):
|
||||
_inherit = "mrp.bom.line"
|
||||
|
||||
has_bom = fields.Boolean(
|
||||
string="Has sub BoM",
|
||||
compute="_compute_has_bom",
|
||||
)
|
||||
|
||||
@api.depends("product_id", "bom_id")
|
||||
def _compute_has_bom(self):
|
||||
# mrp.bom.line _compute_child_bom_id get child bom or return False
|
||||
res = super()._compute_child_bom_id()
|
||||
for line in self:
|
||||
line.has_bom = bool(line.child_bom_id)
|
||||
return res
|
||||
|
||||
def action_open_product_bom_tree_view(self):
|
||||
self.ensure_one()
|
||||
res = self.env["ir.actions.actions"]._for_xml_id("mrp.mrp_bom_form_action")
|
||||
res["domain"] = (
|
||||
"[('id', 'in', [" + ",".join(map(str, self.child_bom_id.ids)) + "])]"
|
||||
)
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _bom_line_find_domain(
|
||||
self,
|
||||
product_tmpl=None,
|
||||
product=None,
|
||||
picking_type=None,
|
||||
company_id=False,
|
||||
bom_type=False,
|
||||
):
|
||||
if product:
|
||||
if not product_tmpl:
|
||||
product_tmpl = product.product_tmpl_id
|
||||
domain = [
|
||||
"|",
|
||||
("product_id", "=", product.id),
|
||||
"&",
|
||||
("product_id", "=", False),
|
||||
("product_tmpl_id", "=", product_tmpl.id),
|
||||
]
|
||||
elif product_tmpl:
|
||||
domain = [("product_tmpl_id", "=", product_tmpl.id)]
|
||||
else:
|
||||
# neither product nor template, makes no sense to search
|
||||
raise UserError(
|
||||
_(
|
||||
"You should provide either a product or "
|
||||
"a product template to search a BoM Line"
|
||||
)
|
||||
)
|
||||
if picking_type:
|
||||
domain += [
|
||||
"|",
|
||||
("bom_id.picking_type_id", "=", picking_type.id),
|
||||
("bom_id.picking_type_id", "=", False),
|
||||
]
|
||||
if company_id or self.env.context.get("company_id"):
|
||||
domain = domain + [
|
||||
"|",
|
||||
("company_id", "=", False),
|
||||
("company_id", "=", company_id or self.env.context.get("company_id")),
|
||||
]
|
||||
if bom_type:
|
||||
domain += [("bom_id.type", "=", bom_type)]
|
||||
# order to prioritize bom line with product_id over the one without
|
||||
return domain
|
||||
|
||||
@api.model
|
||||
def _bom_line_find(
|
||||
self,
|
||||
product_tmpl=None,
|
||||
product=None,
|
||||
picking_type=None,
|
||||
company_id=False,
|
||||
bom_type=False,
|
||||
):
|
||||
"""Finds BoM lines for particular product, picking and company"""
|
||||
if (
|
||||
product
|
||||
and product.type == "service"
|
||||
or product_tmpl
|
||||
and product_tmpl.type == "service"
|
||||
):
|
||||
return self.env["mrp.bom.line"]
|
||||
domain = self._bom_line_find_domain(
|
||||
product_tmpl=product_tmpl,
|
||||
product=product,
|
||||
picking_type=picking_type,
|
||||
company_id=company_id,
|
||||
bom_type=bom_type,
|
||||
)
|
||||
if domain is False:
|
||||
return self.env["mrp.bom.line"]
|
||||
return self.search(domain, order="sequence, product_id")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
|
||||
* Miquel Raïch Regué <miquel.raich@forgeflow.com>
|
||||
* Quentin Dupont <quentin.dupont@grap.coop>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
This module extends the functionality of Bill of Materials
|
||||
to support users to better maintain the BoM hierarchy.
|
||||
|
||||
The user can navigate from the tree view to child's BoM or parent's BoM,
|
||||
or to the product's BoM components with a single click.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
To use this module, you need to go to 'Manufacturing | Products | Bill of
|
||||
Materials'.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
|
|
@ -0,0 +1,92 @@
|
|||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">MRP BoM Hierarchy</h2>
|
||||
<p>
|
||||
This module was written to extend the functionality of Bill of
|
||||
Materials to support users to better maintain the BoM hierarchy.
|
||||
|
||||
This module replaces the existing BoM tree views with a new one, from
|
||||
which the user can create a complete BoM hierarchy.
|
||||
|
||||
The user can navigate from the tree view to child BoM's, or to the
|
||||
product's BoM components with a single click.
|
||||
|
||||
The user can now search using the field 'Complete Reference' (or Name) to
|
||||
find all the BoM hierarchy associated to a particular BoM Reference (or
|
||||
Name) at once.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Installation</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">No specific installation steps are required.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Configuration</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">No specific configuration steps are required.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Usage</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">To use this module, you need to go to 'Manufacturing | Products | Bill of
|
||||
Materials Hierarchy'
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Known issues / Roadmap</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">No issues have been identified with this module.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Credits</h2>
|
||||
</div>
|
||||
<div class="oe_span12">
|
||||
<h3>Contributors</h3>
|
||||
<ul>
|
||||
<li>Jordi Ballester Alomar <<a
|
||||
href="mailto:jordi.ballester@forgeflow.com">jordi.ballester@forgeflow.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="oe_span12">
|
||||
<h3>Maintainer</h3>
|
||||
<p>
|
||||
This module is maintained by the OCA.<br/>
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.<br/>
|
||||
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/>
|
||||
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<record id="mrp_bom_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.bom.form</field>
|
||||
<field name="model">mrp.bom</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_bom_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//notebook/page/field[@name='bom_line_ids']/tree/field[@name='product_tmpl_id']"
|
||||
position="after"
|
||||
>
|
||||
<field name="has_bom" invisible="1" />
|
||||
<button
|
||||
title="View product's BoM"
|
||||
name="action_open_product_bom_tree_view"
|
||||
type="object"
|
||||
class="btn btn-link"
|
||||
icon="fa-folder-open"
|
||||
attrs="{'invisible': [('has_bom', '!=', True)]}"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mrp_bom_filter" model="ir.ui.view">
|
||||
<field name="name">mrp.bom.select</field>
|
||||
<field name="model">mrp.bom</field>
|
||||
<field name="inherit_id" ref="mrp.view_mrp_bom_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//separator[1]" position="before">
|
||||
<field name="has_parent" />
|
||||
<field name="has_child" />
|
||||
<separator />
|
||||
<filter
|
||||
string="Has parent BoMs"
|
||||
name="parent_bom"
|
||||
domain="[('has_parent','=','True')]"
|
||||
/>
|
||||
<filter
|
||||
string="Has child BoMs"
|
||||
name="child_bom"
|
||||
domain="[('has_child','=','True')]"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_bom_hierarchy_tree_view" model="ir.ui.view">
|
||||
<field name="name">mrp.bom.tree</field>
|
||||
<field name="model">mrp.bom</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_bom_tree_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="active" position="before">
|
||||
<button
|
||||
title="Parent BoMs"
|
||||
name="action_open_parent_tree_view"
|
||||
type="object"
|
||||
class="btn btn-link"
|
||||
icon="fa-level-up"
|
||||
attrs="{'invisible': [('has_parent', '!=', True)]}"
|
||||
/>
|
||||
<button
|
||||
title="Child BoMs"
|
||||
name="action_open_child_tree_view"
|
||||
type="object"
|
||||
class="btn btn-link"
|
||||
icon="fa-level-down"
|
||||
attrs="{'invisible': [('has_child', '!=', True)]}"
|
||||
/>
|
||||
<field name="has_parent" invisible="1" />
|
||||
<field name="has_child" invisible="1" />
|
||||
</field>
|
||||
<field name="type" position="before">
|
||||
<field name="product_has_other_bom" invisible="1" />
|
||||
<button
|
||||
title="View product's other BoMs"
|
||||
name="action_open_product_other_bom_tree_view"
|
||||
type="object"
|
||||
class="btn btn-link"
|
||||
icon="fa-folder-open"
|
||||
attrs="{'invisible': [('product_has_other_bom', '!=', True)]}"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-manufacture-mrp_bom_hierarchy"
|
||||
version = "16.0.0"
|
||||
description = "MRP BoM Hierarchy - Make it easy to navigate through BoM hierarchy."
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-ocb-mrp>=16.0.0",
|
||||
"requests>=2.25.1"
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">= 3.11"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Office/Business",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/bringout/0"
|
||||
repository = "https://github.com/bringout/0"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["mrp_bom_hierarchy"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue