Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[16.0][MIG] sale_order_weight: Migration to 16.0 (from 12.0) #3414

Open
wants to merge 23 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7279887
[ADD] sale_order_weight: New module to 12.0
manuelcalerosolis Apr 14, 2021
984c7a1
Add button to recalculate weight
manuelcalerosolis Jul 22, 2021
5196c79
[UPD] Update sale_order_weight.pot
oca-travis Jul 28, 2021
847da2a
[UPD] README.rst
OCA-git-bot Jul 28, 2021
f49722e
sale_order_weight 12.0.1.0.1
OCA-git-bot Jul 28, 2021
5ebfb22
[12.0][IMP] copier
sergiocorato Dec 13, 2022
298b338
sale_order_weight 12.0.1.0.2
OCA-git-bot Dec 14, 2022
d1c7b8c
[UPD] README.rst
OCA-git-bot Sep 3, 2023
d2af346
Update translation files
weblate Oct 9, 2023
db86c7f
[REF] sale_order_weight : simplify test code. Remove call of _onchang…
legalsylvain Nov 28, 2023
13f3204
[FIX] sale_order_weight : store intermediate total_ordered_weight on …
legalsylvain Nov 28, 2023
db0c97b
[IMP] sale_order_weight : display weight information after all order …
legalsylvain Nov 28, 2023
95afc22
[IMP] sale_order_weight : display unit_weight in sale order form view…
legalsylvain Nov 28, 2023
9130763
[REF] sale_order_weight : hide total_ordered_weight in order line tre…
legalsylvain Nov 28, 2023
126a324
[REF] sale_order_weight : module adopted
legalsylvain Nov 28, 2023
1959c43
[IMP] sale_order_weight : fast prepopulate sale_order_line.unit_weigh…
legalsylvain Nov 28, 2023
a746bdb
[FIX] sale_order_weight : display also total_delivery_weight on sale_…
legalsylvain Nov 28, 2023
44eca4c
[ADD] sale_order_weight : french translation
legalsylvain Nov 28, 2023
50ae5d9
fixup! [IMP] sale_order_weight : fast prepopulate sale_order_line.uni…
legalsylvain Dec 3, 2023
99b37e9
[BOT] post-merge updates
OCA-git-bot Oct 16, 2024
ee705d1
[IMP] sale_order_weight: pre-commit stuff
legalsylvain Nov 18, 2024
0aa0b89
[MIG] sale_order_weight: Migration to 16.0 (from 12.0)
legalsylvain Nov 18, 2024
34ad4d8
[REF] sale_order_weight: rename into sale_order_ordered_weight, to av…
legalsylvain Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions sale_order_weight/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
=================
Sale Order Weight
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6c59da35017eadc3724250770bc60296ba21ae7ec3902b2171477d8b8e3d3247
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/16.0/sale_order_weight
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_weight
: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/sale-workflow&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module is used to calculate the weight (Ordered Products) in a sale order.

The weight can be displayed on the sale order report.


**Table of contents**

.. contents::
:local:

Configuration
=============

* Go to "Sales > Configuration > Settings"

.. figure:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_order_weight/static/description/configuration.png

Display Order weight is checked by default.

The weight display at line level is hidden by default, to avoid burdening the PDF report.

Usage
=====

* Go to a sale order.

The ordered weights are displayed on each order lines and at order level.

.. figure:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_order_weight/static/description/sale_order_form.png

Note: The weight are also available on the order tree view. (hidden by default)

* Print a sale order.

.. figure:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_order_weight/static/description/sale_order_report.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-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/sale-workflow/issues/new?body=module:%20sale_order_weight%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
~~~~~~~

* GRAP
* Xtendoo

Contributors
~~~~~~~~~~~~

* Manuel Calero - https://xtendoo.es <[email protected]>
* Sylvain LE GAL

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-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.0/sale_order_weight>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions sale_order_weight/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2021 Manuel Calero Solís (https://xtendoo.es)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from .pre_init_hook import pre_init_hook
20 changes: 20 additions & 0 deletions sale_order_weight/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2021 Manuel Calero Solís (https://xtendoo.es)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Order Weight",
"summary": "Add Ordered weights on sale order and sale order line levels",
"version": "16.0.1.0.0",
"category": "Sales",
"author": "GRAP, Xtendoo, Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/sale-workflow",
"license": "AGPL-3",
"installable": True,
"depends": ["sale"],
"data": [
"views/sale_order_view.xml",
"views/res_config_settings_view.xml",
"reports/report_sale_order.xml",
],
"pre_init_hook": "pre_init_hook",
}
56 changes: 56 additions & 0 deletions sale_order_weight/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_weight
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-23 06:28+0000\n"
"PO-Revision-Date: 2021-04-23 06:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_order_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.view_order_form_inherit
msgid "Recalculate weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order
msgid "Sale Order"
msgstr "Pedido de venta"

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de pedido de venta"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_delivered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_delivered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Delivered Weight"
msgstr "Total Peso Enviado"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_ordered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_ordered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Ordered Weight"
msgstr "Total Peso Pedido"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__unit_weight
msgid "Unit Weight"
msgstr "Peso Unidad"

#~ msgid "Total Weight"
#~ msgstr "Total Peso"
53 changes: 53 additions & 0 deletions sale_order_weight/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_weight
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-28 22:17+0000\n"
"PO-Revision-Date: 2023-11-28 22:17+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_order_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.view_order_form_inherit
msgid "Recalculate weight"
msgstr "Recalculer le poids"

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order
msgid "Sale Order"
msgstr "Bon de commande"

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de bons de commande"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_delivered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_delivered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Delivered Weight"
msgstr "Poids livré"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_ordered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_ordered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Ordered Weight"
msgstr "Poids commandé"

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__unit_weight
msgid "Unit Weight"
msgstr "Poids unitaire"

53 changes: 53 additions & 0 deletions sale_order_weight/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_weight
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-23 06:28+0000\n"
"PO-Revision-Date: 2021-04-23 06:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_order_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.view_order_form_inherit
msgid "Recalculate weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order
msgid "Sale Order"
msgstr ""

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_delivered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_delivered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Delivered Weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_ordered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_ordered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Ordered Weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__unit_weight
msgid "Unit Weight"
msgstr ""
51 changes: 51 additions & 0 deletions sale_order_weight/i18n/sale_order_weight.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_weight
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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: sale_order_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.view_order_form_inherit
msgid "Recalculate weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order
msgid "Sale Order"
msgstr ""

#. module: sale_order_weight
#: model:ir.model,name:sale_order_weight.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_delivered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_delivered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Delivered Weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order__total_ordered_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__total_ordered_weight
#: model_terms:ir.ui.view,arch_db:sale_order_weight.quotation_weight_view_form
#: model_terms:ir.ui.view,arch_db:sale_order_weight.sale_order_weight_view_form
msgid "Total Ordered Weight"
msgstr ""

#. module: sale_order_weight
#: model:ir.model.fields,field_description:sale_order_weight.field_sale_order_line__unit_weight
msgid "Unit Weight"
msgstr ""

17 changes: 17 additions & 0 deletions sale_order_weight/migrations/16.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade

# pylint: disable=W8150
from odoo.addons.sale_order_weight import pre_init_hook


@openupgrade.migrate()
def migrate(env, version):
# we recompute the weights because in previous implementation,
# 1) the UoM conversion was not done, so the value could be incorrect
# 2) the recompute was not done when the weight of the product has changed
# so the value could be obsolete.
pre_init_hook(env.cr)
4 changes: 4 additions & 0 deletions sale_order_weight/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import res_company
from . import res_config_settings
from . import sale_order
from . import sale_order_line
11 changes: 11 additions & 0 deletions sale_order_weight/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

display_line_weight_on_sale_report = fields.Boolean(default=False)

display_order_weight_on_sale_report = fields.Boolean(default=True)
Loading
Loading