Add oca-purchase submodule with 96 purchase modules moved from oca-workflow-process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ernad Husremovic 2025-08-30 18:00:40 +02:00
parent b0628ee8ea
commit 7378b233e9
3994 changed files with 334316 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Purchase Order Weight and Volume
Odoo addon: purchase_order_weight_volume
## Installation
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_order_weight_volume
```
## Dependencies
This addon depends on:
- purchase
## Manifest Information
- **Name**: Purchase Order Weight and Volume
- **Version**: 16.0.2.2.0
- **Category**: Purchase Management
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/purchase-workflow](https://github.com/OCA/purchase-workflow) branch 16.0, addon `purchase_order_weight_volume`.
## 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
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.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

View file

@ -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 Purchase_order_weight_volume Module - purchase_order_weight_volume
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.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for purchase_order_weight_volume. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [purchase](https://github.com/bringout/oca-ocb-core/tree/b3e6fb998e53b9eb1bc9669d992017616c2bd7b3/odoo-bringout-oca-ocb-purchase)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon purchase_order_weight_volume or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_order_weight_volume"
# or
uv pip install odoo-bringout-oca-purchase-workflow-purchase_order_weight_volume"
```

View file

@ -0,0 +1,15 @@
# Models
Detected core models and extensions in purchase_order_weight_volume.
```mermaid
classDiagram
class purchase_order
class purchase_order_line
class res_company
class res_config_settings
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: purchase_order_weight_volume. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon purchase_order_weight_volume
- License: LGPL-3

View file

@ -0,0 +1,22 @@
# Reports
Report definitions and templates in purchase_order_weight_volume.
```mermaid
classDiagram
```
## Available Reports
No named reports found in XML files.
## Report Files
- **purchase_report_templates.xml** (XML template/definition)
## Notes
- Named reports above are accessible through Odoo's reporting menu
- Python files define report logic and data processing
- XML files contain report templates, definitions, and formatting
- Reports are integrated with Odoo's printing and email systems

View file

@ -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

View file

@ -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.

View file

@ -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 purchase_order_weight_volume
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,110 @@
================================
Purchase Order Weight and Volume
================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1e20a810eb5dbcef014c5de0ea70d6827f681ddd267fab8ef7c6b76903b17ff6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_weight_volume
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_order_weight_volume
: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/purchase-workflow&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
- Display weight and volume in Purchase Order Line.
- Display total order weight and total order volume in Purchase Order, tab "Other information".
**Table of contents**
.. contents::
:local:
Usage
=====
To use this module, you need to:
* Go to Purchase settings.
* Enable checkboxes "Display Order Weight in PO" and/or "Display Order Volume in PO".
* Go to Products. Update some products with weight and volume values.
* Go to Purchase.
* Create new RFQ. Add products.
* You will see new column with total line items weight and volume.
* You will see order total weight and volume, tab "Other information".
* From this tab, you can also choose whether to display weight and/or volume info in report.
"Display Order Weight in PO" and "Display Order Volume in PO" can be enabled/disabled
per company.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%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
~~~~~~~
* Ilyas
* Ooops404
Contributors
~~~~~~~~~~~~
* `Ooops404 <https://www.ooops404.com>`__:
* Ilyas <irazor147@gmail.com>
Other credits
~~~~~~~~~~~~~
The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp.
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.
.. |maintainer-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
:target: https://github.com/ilyasProgrammer
:alt: ilyasProgrammer
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-ilyasProgrammer|
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_weight_volume>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,21 @@
# Copyright 2023 ooops404
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase Order Weight and Volume",
"summary": """Display purchase order weight and volume""",
"version": "16.0.2.2.0",
"author": "Ilyas, Ooops404, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"category": "Purchase Management",
"maintainers": ["ilyasProgrammer"],
"license": "AGPL-3",
"depends": [
"purchase",
],
"data": [
"views/purchase_order_view.xml",
"views/res_config_settings_views.xml",
"report/purchase_report_templates.xml",
],
"installable": True,
}

View file

@ -0,0 +1,112 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_weight_volume
#
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: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Volume</strong>"
msgstr "<strong>Ukupno Volume</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Weight</strong>"
msgstr "<strong>Ukupno Weight</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Volume</strong>"
msgstr "<strong>Volume</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Weight</strong>"
msgstr "<strong>Težina</strong>"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_company
msgid "Companies"
msgstr "Kompanije"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_volume_in_po
msgid "Display Order Volume in PO"
msgstr "Display Nalog Volume in PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_weight_in_po
msgid "Display Order Weight in PO"
msgstr "Display Nalog Weight in PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_volume_in_report
msgid "Display Volume in Report"
msgstr "Display Volume in Report"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_weight_in_report
msgid "Display Weight in Report"
msgstr "Display Weight in Report"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "Postavke grupiranja nabavki za prokuraciju"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order
msgid "Purchase Order"
msgstr "Nalog za nabavu"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka naloga za nabavu"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume
msgid "Total Volume"
msgstr "Ukupno Volume"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume_uom_id
msgid "Total Volume Uom"
msgstr "Ukupno Volume Uom"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight
msgid "Total Weight"
msgstr "Ukupno Weight"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight_uom_id
msgid "Total Weight Uom"
msgstr "Ukupno Weight Uom"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_volume
msgid "Volume"
msgstr "Volumen"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_weight
msgid "Weight"
msgstr "Težina"

View file

@ -0,0 +1,124 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_weight_volume
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-18 08:37+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: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Volume</strong>"
msgstr "<strong>Volumen total</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Weight</strong>"
msgstr "<strong>Peso total</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Volume</strong>"
msgstr "<strong>Volumen</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Weight</strong>"
msgstr "<strong>Peso</strong>"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_volume_in_po
msgid "Display Order Volume in PO"
msgstr "Visualizar volumen de pedido en PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_weight_in_po
msgid "Display Order Weight in PO"
msgstr "Visualizar peso de pedido en PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_volume_in_report
msgid "Display Volume in Report"
msgstr "Mostrar volumen en el informe"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_weight_in_report
msgid "Display Weight in Report"
msgstr "Mostrar el peso en el informe"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "Configuración de la agrupación de los abastecimientos"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order
msgid "Purchase Order"
msgstr "Orden de Compra"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea de Orden de Compra"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume
msgid "Total Volume"
msgstr "Volumen Total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume_uom_id
msgid "Total Volume Uom"
msgstr "Volumen Total Udm"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight
msgid "Total Weight"
msgstr "Peso Total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight_uom_id
msgid "Total Weight Uom"
msgstr "Peso Total Udm"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_volume
msgid "Volume"
msgstr "Volumen"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_weight
msgid "Weight"
msgstr "Peso"
#~ msgid "Config Settings"
#~ msgstr "Ajustes de Configuración"
#~ msgid "Volume Uom Name"
#~ msgstr "Nombre UdM Volumen"
#~ msgid "Weight Uom Name"
#~ msgstr "Nombre UdM Peso"

View file

@ -0,0 +1,115 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_weight_volume
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-12-31 13:06+0000\n"
"Last-Translator: samibc2c <sami.bouzidi@camptocamp.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: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Volume</strong>"
msgstr "<strong>Volume Total</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Weight</strong>"
msgstr "<strong>Poids Total</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Volume</strong>"
msgstr "<strong>Volume</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Weight</strong>"
msgstr "<strong>Poids</strong>"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_company
msgid "Companies"
msgstr "Sociétés"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_volume_in_po
msgid "Display Order Volume in PO"
msgstr "Afficher le Volume de la commande sur le PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_weight_in_po
msgid "Display Order Weight in PO"
msgstr "Afficher le Poids de la commande sur le PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_volume_in_report
msgid "Display Volume in Report"
msgstr "Afficher le Volume sur le rapport"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_weight_in_report
msgid "Display Weight in Report"
msgstr "Afficher le poids sur le rapport"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "Paramètres de regroupement des achats"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order
msgid "Purchase Order"
msgstr "Commande d'achat"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ligne de commande d'achat"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume
msgid "Total Volume"
msgstr "Volume total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume_uom_id
msgid "Total Volume Uom"
msgstr "Udm du volume total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight
msgid "Total Weight"
msgstr "Poids Total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight_uom_id
msgid "Total Weight Uom"
msgstr "Udm du poids total"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_volume
msgid "Volume"
msgstr "Volume"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_weight
msgid "Weight"
msgstr "Poids"

View file

@ -0,0 +1,133 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_weight_volume
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-20 15:38+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.17\n"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Volume</strong>"
msgstr "<strong>Volume totale</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Weight</strong>"
msgstr "<strong>Peso totale</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Volume</strong>"
msgstr "<strong>Volume</strong>"
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Weight</strong>"
msgstr "<strong>Peso</strong>"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_company
msgid "Companies"
msgstr "Aziende"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_volume_in_po
msgid "Display Order Volume in PO"
msgstr "Mostra Volume ordine nel PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_weight_in_po
msgid "Display Order Weight in PO"
msgstr "Mostra peso ordine nel PO"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_volume_in_report
msgid "Display Volume in Report"
msgstr "Mostra volume nella stampa"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_weight_in_report
msgid "Display Weight in Report"
msgstr "Mostra peso nella stampa"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "Impostazioni raggruppamento approvvigionamento acquisti"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume
msgid "Total Volume"
msgstr "Volume totale"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume_uom_id
msgid "Total Volume Uom"
msgstr "UdM volume totale"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight
msgid "Total Weight"
msgstr "Peso totale"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight_uom_id
msgid "Total Weight Uom"
msgstr "UdM peso totale"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_volume
msgid "Volume"
msgstr "Volume"
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_weight
msgid "Weight"
msgstr "Peso"
#~ msgid "Config Settings"
#~ msgstr "Impostazioni configurazione"
#~ msgid "Volume Uom Name"
#~ msgstr "Nome udm volume"
#~ msgid "Weight Uom Name"
#~ msgstr "Nome udm peso"
#~ msgid "Display Name"
#~ msgstr "Nome da visualizzare"
#~ msgid "ID"
#~ msgstr "ID"
#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"

View file

@ -0,0 +1,112 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_weight_volume
#
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: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Volume</strong>"
msgstr ""
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Total Weight</strong>"
msgstr ""
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Volume</strong>"
msgstr ""
#. module: purchase_order_weight_volume
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchaseorder_document
#: model_terms:ir.ui.view,arch_db:purchase_order_weight_volume.report_purchasequotation_document
msgid "<strong>Weight</strong>"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_company
msgid "Companies"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_volume_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_volume_in_po
msgid "Display Order Volume in PO"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_company__display_order_weight_in_po
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_res_config_settings__display_order_weight_in_po
msgid "Display Order Weight in PO"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_volume_in_report
msgid "Display Volume in Report"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__display_total_weight_in_report
msgid "Display Weight in Report"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model,name:purchase_order_weight_volume.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume
msgid "Total Volume"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_volume_uom_id
msgid "Total Volume Uom"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight
msgid "Total Weight"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order__total_weight_uom_id
msgid "Total Weight Uom"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_volume
msgid "Volume"
msgstr ""
#. module: purchase_order_weight_volume
#: model:ir.model.fields,field_description:purchase_order_weight_volume.field_purchase_order_line__line_weight
msgid "Weight"
msgstr ""

View file

@ -0,0 +1,3 @@
from . import purchase_order
from . import res_company
from . import res_config_settings

View file

@ -0,0 +1,95 @@
# Copyright 2023 ooops404
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
line_weight = fields.Float(
"Weight", compute="_compute_line_physical_properties", digits="Stock Weight"
)
line_volume = fields.Float(
"Volume", compute="_compute_line_physical_properties", digits="Volume"
)
@api.depends("product_uom_qty", "product_id")
def _compute_line_physical_properties(self):
for line in self:
line.line_weight = line.product_id.weight * line.product_uom_qty
line.line_volume = line.product_id.volume * line.product_uom_qty
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
total_weight = fields.Float(
compute="_compute_total_physical_properties",
digits="Stock Weight",
store=True,
)
total_volume = fields.Float(
compute="_compute_total_physical_properties",
digits="Volume",
store=True,
)
total_weight_uom_id = fields.Many2one(
"uom.uom",
compute="_compute_total_physical_properties",
store=True,
)
total_volume_uom_id = fields.Many2one(
"uom.uom",
compute="_compute_total_physical_properties",
store=True,
)
display_total_weight_in_report = fields.Boolean(
"Display Weight in Report", default=True
)
display_total_volume_in_report = fields.Boolean(
"Display Volume in Report", default=True
)
display_order_weight_in_po = fields.Boolean(
"Display Order Weight in PO",
compute="_compute_display_order",
)
display_order_volume_in_po = fields.Boolean(
"Display Order Volume in PO",
compute="_compute_display_order",
)
@api.depends("company_id")
def _compute_display_order(self):
for purchase in self:
self.display_order_weight_in_po = (
purchase.company_id.display_order_weight_in_po
)
self.display_order_volume_in_po = (
purchase.company_id.display_order_volume_in_po
)
@api.depends("order_line.product_uom_qty", "order_line.product_id")
def _compute_total_physical_properties(self):
default_weight_uom = (
self.env["ir.config_parameter"]
.sudo()
.get_param("product_default_weight_uom_id")
)
default_volume_uom = (
self.env["ir.config_parameter"]
.sudo()
.get_param("product_default_volume_uom_id")
)
for po in self:
po.total_weight = 0
po.total_volume = 0
if default_weight_uom:
po.total_weight_uom_id = int(default_weight_uom)
if default_volume_uom:
po.total_volume_uom_id = int(default_volume_uom)
if po.company_id.display_order_weight_in_po and po.total_weight_uom_id:
po.total_weight = sum(po.mapped("order_line.line_weight"))
if po.company_id.display_order_volume_in_po and po.total_volume_uom_id:
po.total_volume = sum(po.mapped("order_line.line_volume"))

View file

@ -0,0 +1,16 @@
# Copyright 2023 ooops404
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
display_order_weight_in_po = fields.Boolean(
"Display Order Weight in PO",
default=True,
)
display_order_volume_in_po = fields.Boolean(
"Display Order Volume in PO",
default=True,
)

View file

@ -0,0 +1,16 @@
# Copyright 2023 ooops404
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
display_order_weight_in_po = fields.Boolean(
related="company_id.display_order_weight_in_po",
readonly=False,
)
display_order_volume_in_po = fields.Boolean(
related="company_id.display_order_volume_in_po",
readonly=False,
)

View file

@ -0,0 +1,3 @@
* `Ooops404 <https://www.ooops404.com>`__:
* Ilyas <irazor147@gmail.com>

View file

@ -0,0 +1 @@
The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp.

View file

@ -0,0 +1,2 @@
- Display weight and volume in Purchase Order Line.
- Display total order weight and total order volume in Purchase Order, tab "Other information".

View file

@ -0,0 +1,13 @@
To use this module, you need to:
* Go to Purchase settings.
* Enable checkboxes "Display Order Weight in PO" and/or "Display Order Volume in PO".
* Go to Products. Update some products with weight and volume values.
* Go to Purchase.
* Create new RFQ. Add products.
* You will see new column with total line items weight and volume.
* You will see order total weight and volume, tab "Other information".
* From this tab, you can also choose whether to display weight and/or volume info in report.
"Display Order Weight in PO" and "Display Order Volume in PO" can be enabled/disabled
per company.

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="report_purchasequotation_document"
inherit_id="purchase.report_purchasequotation_document"
>
<xpath expr="//table" position="after">
<br />
<div id="weight_and_volume" class="row justify-content-end">
<div class="col-4">
<table class="table table-sm">
<tr t-if="o.display_total_weight_in_report">
<td><strong>Total Weight</strong></td>
<td class="text-right">
<span t-field="o.total_weight" />
<span t-field="o.total_weight_uom_id" />
</td>
</tr>
<tr t-if="o.display_total_volume_in_report">
<td><strong>Total Volume</strong></td>
<td class="text-right">
<span t-field="o.total_volume" />
<span t-field="o.total_volume_uom_id" />
</td>
</tr>
</table>
</div>
</div>
</xpath>
<xpath expr="//th[@name='th_quantity']" position="before">
<th
t-if="o.display_total_weight_in_report"
name="th_weight"
class="text-right"
>
<strong>Weight</strong>
</th>
<th
t-if="o.display_total_volume_in_report"
name="th_volume"
class="text-right"
>
<strong>Volume</strong>
</th>
</xpath>
<xpath expr="//span[@t-field='order_line.product_qty']/.." position="before">
<td t-if="o.display_total_weight_in_report" class="text-right">
<span t-field="order_line.line_weight" />
<span t-field="order_line.order_id.total_weight_uom_id" />
</td>
<td t-if="o.display_total_volume_in_report" class="text-right">
<span t-field="order_line.line_volume" />
<span t-field="order_line.order_id.total_volume_uom_id" />
</td>
</xpath>
</template>
<template
id="report_purchaseorder_document"
inherit_id="purchase.report_purchaseorder_document"
>
<xpath expr="//div[@id='total']" position="after">
<br />
<div id="weight_and_volume" class="row justify-content-end">
<div class="col-4">
<table class="table table-sm">
<tr t-if="o.display_total_weight_in_report">
<td><strong>Total Weight</strong></td>
<td class="text-right">
<span t-field="o.total_weight" />
<span t-field="o.total_weight_uom_id" />
</td>
</tr>
<tr t-if="o.display_total_volume_in_report">
<td><strong>Total Volume</strong></td>
<td class="text-right">
<span t-field="o.total_volume" />
<span t-field="o.total_volume_uom_id" />
</td>
</tr>
</table>
</div>
</div>
</xpath>
<xpath expr="//th[@name='th_quantity']" position="before">
<th
t-if="o.display_total_weight_in_report"
name="th_weight"
class="text-right"
>
<strong>Weight</strong>
</th>
<th
t-if="o.display_total_volume_in_report"
name="th_volume"
class="text-right"
>
<strong>Volume</strong>
</th>
</xpath>
<xpath expr="//span[@t-field='line.product_qty']/.." position="before">
<td t-if="o.display_total_weight_in_report" class="text-right">
<span t-field="line.line_weight" />
<span t-field="line.order_id.total_weight_uom_id" />
</td>
<td t-if="o.display_total_volume_in_report" class="text-right">
<span t-field="line.line_volume" />
<span t-field="line.order_id.total_volume_uom_id" />
</td>
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,452 @@
<?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: https://docutils.sourceforge.io/" />
<title>Purchase Order Weight and Volume</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/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="purchase-order-weight-and-volume">
<h1 class="title">Purchase Order Weight and Volume</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1e20a810eb5dbcef014c5de0ea70d6827f681ddd267fab8ef7c6b76903b17ff6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/purchase-workflow/tree/16.0/purchase_order_weight_volume"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_order_weight_volume"><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/purchase-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<ul class="simple">
<li>Display weight and volume in Purchase Order Line.</li>
<li>Display total order weight and total order volume in Purchase Order, tab “Other information”.</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="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To use this module, you need to:</p>
<ul class="simple">
<li>Go to Purchase settings.</li>
<li>Enable checkboxes “Display Order Weight in PO” and/or “Display Order Volume in PO”.</li>
<li>Go to Products. Update some products with weight and volume values.</li>
<li>Go to Purchase.</li>
<li>Create new RFQ. Add products.</li>
<li>You will see new column with total line items weight and volume.</li>
<li>You will see order total weight and volume, tab “Other information”.</li>
<li>From this tab, you can also choose whether to display weight and/or volume info in report.</li>
</ul>
<p>“Display Order Weight in PO” and “Display Order Volume in PO” can be enabled/disabled
per company.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_order_weight_volume%0Aversion:%2016.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="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Ilyas</li>
<li>Ooops404</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.ooops404.com">Ooops404</a>:<ul>
<li>Ilyas &lt;<a class="reference external" href="mailto:irazor147&#64;gmail.com">irazor147&#64;gmail.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<p>The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp.</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<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>
<p>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.</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/ilyasProgrammer"><img alt="ilyasProgrammer" src="https://github.com/ilyasProgrammer.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_weight_volume">OCA/purchase-workflow</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>
</div>
</div>
</div>
</body>
</html>

View file

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

View file

@ -0,0 +1,138 @@
# Copyright 2023 Camptocamp
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
import time
from odoo.tests.common import TransactionCase
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class TestPurchaseOrderWeightVolume(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.po_obj = cls.env["purchase.order"]
cls.company_obj = cls.env["res.company"]
# Company
cls._prepare_company()
# Partner
cls._prepare_partner()
# Product
cls._prepare_product()
# Lines of Purchase Order
cls._prepare_line_products()
# UoM
cls._prepare_uom()
@classmethod
def _prepare_company(cls):
cls.company1 = cls.company_obj.create(
{
"name": "Company 1",
"display_order_weight_in_po": True,
"display_order_volume_in_po": True,
}
)
@classmethod
def _prepare_partner(cls):
cls.partner1 = cls.env.ref("base.res_partner_12")
@classmethod
def _prepare_product(cls):
cls.product1 = cls.env.ref("product.product_product_6")
cls.product1.write(
{
"weight": 5,
"volume": 50,
}
)
cls.product2 = cls.env.ref("product.product_product_7")
cls.product2.write(
{
"weight": 0.5,
"volume": 15,
}
)
@classmethod
def _prepare_line_products(cls):
cls.line_products = [
(cls.product1, 10),
(cls.product2, 5),
]
cls.total_weight = 0
cls.total_volume = 0
for product, qty in cls.line_products:
cls.total_weight += product.weight * qty
cls.total_volume += product.volume * qty
@classmethod
def _prepare_uom(cls):
# Configure weight in kg
cls.product_uom_kgm = cls.env.ref("uom.product_uom_kgm")
cls.env["ir.config_parameter"].sudo().set_param(
"product_default_weight_uom_id", cls.product_uom_kgm.id
)
# Configure volume in m3
cls.product_uom_cubic_meter = cls.env.ref("uom.product_uom_cubic_meter")
cls.env["ir.config_parameter"].sudo().set_param(
"product_default_volume_uom_id", cls.product_uom_cubic_meter.id
)
def test_purchase_order_weight_volume(self):
po = self._create_purchase(self.line_products)
# Purchase Order
self.assertEqual(po.total_weight, self.total_weight)
self.assertEqual(po.total_weight_uom_id, self.product_uom_kgm)
self.assertEqual(po.total_volume, self.total_volume)
self.assertEqual(po.total_volume_uom_id, self.product_uom_cubic_meter)
# Purchase Order Line
for line in po.order_line:
self.assertEqual(
line.line_weight, line.product_id.weight * line.product_uom_qty
)
self.assertEqual(
line.line_volume, line.product_id.volume * line.product_uom_qty
)
def _create_purchase(self, line_products):
"""Create a purchase order.
``line_products`` is a list of tuple [(product, qty)]
"""
lines = []
for product, qty in line_products:
line_values = {
"name": product.name,
"product_id": product.id,
"product_qty": qty,
"product_uom": product.uom_id.id,
"price_unit": 100,
"date_planned": time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
}
lines.append((0, 0, line_values))
res = self.po_obj.create(
{
"partner_id": self.partner1.id,
"order_line": lines,
}
)
return res

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="purchase_order_form_inerit" model="ir.ui.view">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='order_line']//tree//field[@name='price_unit']"
position="before"
>
<field name="line_weight" optional="hide" />
<field name="line_volume" optional="hide" />
</xpath>
<xpath
expr="//field[@name='tax_totals']/parent::group[last()]/parent::group[last()]"
position="after"
>
<group class="oe_right">
<label
for="total_weight"
attrs="{'invisible':['|',('total_weight_uom_id', '=', False),('display_order_weight_in_po', '=', False)]}"
/>
<div
class="text-nowrap"
attrs="{'invisible':['|',('total_weight_uom_id', '=', False),('display_order_weight_in_po', '=', False)]}"
>
<field name="total_weight" class="oe_inline" />
<span style="margin-left:3px;"><field
name="total_weight_uom_id"
class="oe_inline pull-right"
/></span>
</div>
<label
for="total_volume"
attrs="{'invisible':['|',('total_volume_uom_id', '=', False),('display_order_volume_in_po', '=', False)]}"
/>
<div
class="text-nowrap"
attrs="{'invisible':['|',('total_volume_uom_id', '=', False),('display_order_volume_in_po', '=', False)]}"
>
<field name="total_volume" class="oe_inline" />
<span style="margin-left:3px;"><field
name="total_volume_uom_id"
class="oe_inline pull-right"
/></span>
</div>
</group>
</xpath>
<field name="fiscal_position_id" position="after">
<field name="display_total_weight_in_report" />
<field name="display_total_volume_in_report" />
<field name="display_order_weight_in_po" invisible="1" />
<field name="display_order_volume_in_po" invisible="1" />
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_config_settings_view_form_purchase_inherit" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="25" />
<field
name="inherit_id"
ref="purchase.res_config_settings_view_form_purchase"
/>
<field name="arch" type="xml">
<xpath expr="//div[@id='auto_receipt_reminder']" position="after">
<div class="col-12 col-lg-6 o_setting_box" id="display_weight_in_po">
<div class="o_setting_left_pane">
<field name="display_order_weight_in_po" />
</div>
<div class="o_setting_right_pane">
<label for="display_order_weight_in_po" />
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="display_volume_in_po">
<div class="o_setting_left_pane">
<field name="display_order_volume_in_po" />
</div>
<div class="o_setting_right_pane">
<label for="display_order_volume_in_po" />
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-purchase-workflow-purchase_order_weight_volume"
version = "16.0.0"
description = "Purchase Order Weight and Volume - Display purchase order weight and volume"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-purchase>=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 = ["purchase_order_weight_volume"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]