Skip to content

Commit 3b21181

Browse files
committed
Merge PR #962 into 18.0
Signed-off-by simahawk
2 parents 9e7d73d + 55298b3 commit 3b21181

17 files changed

+808
-0
lines changed
+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
==============================
2+
Delivery Carrier Manual Weight
3+
==============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:cb7ec31b8da17884fe4d5613b5dc090c793371ad7f11e667d830d58cb03b4047
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github
20+
:target: https://github.com/OCA/delivery-carrier/tree/18.0/delivery_carrier_manual_weight
21+
:alt: OCA/delivery-carrier
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/delivery-carrier-18-0/delivery-carrier-18-0-delivery_carrier_manual_weight
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module adds a flag in Shipping Methods to allow to set manually the
32+
weight and shipping weight in each transfer.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Usage
40+
=====
41+
42+
In stock transfers, when using a 'Manual Weights' carrier, two new
43+
fields will be available to fill manually the weight and the shipping
44+
weight.
45+
46+
Bug Tracker
47+
===========
48+
49+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/issues>`_.
50+
In case of trouble, please check there if your issue has already been reported.
51+
If you spotted it first, help us to smash it by providing a detailed and welcomed
52+
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_carrier_manual_weight%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
53+
54+
Do not contact contributors directly about support or help with technical issues.
55+
56+
Credits
57+
=======
58+
59+
Authors
60+
-------
61+
62+
* ForgeFlow
63+
64+
Contributors
65+
------------
66+
67+
- Jordi Masvidal <jordi.masvidal@forgeflow.com>
68+
- Marina Alapont <marina.alapont@forgeflow.com>
69+
- Manuel Regidor <manuel.regidor@sygel.es>
70+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
71+
72+
- Bhavesh Heliconia
73+
74+
Maintainers
75+
-----------
76+
77+
This module is maintained by the OCA.
78+
79+
.. image:: https://odoo-community.org/logo.png
80+
:alt: Odoo Community Association
81+
:target: https://odoo-community.org
82+
83+
OCA, or the Odoo Community Association, is a nonprofit organization whose
84+
mission is to support the collaborative development of Odoo features and
85+
promote its widespread use.
86+
87+
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/18.0/delivery_carrier_manual_weight>`_ project on GitHub.
88+
89+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
5+
{
6+
"name": "Delivery Carrier Manual Weight",
7+
"summary": """
8+
Allow setting weight and shipping weight in stock transfers manually
9+
based on carrier.
10+
""",
11+
"version": "18.0.1.0.0",
12+
"category": "Delivery",
13+
"website": "https://github.com/OCA/delivery-carrier",
14+
"author": "ForgeFlow,Odoo Community Association (OCA)",
15+
"license": "AGPL-3",
16+
"depends": [
17+
"stock_delivery",
18+
],
19+
"data": ["views/delivery_view.xml"],
20+
"application": False,
21+
"installable": True,
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * delivery_carrier_manual_weight
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: delivery_carrier_manual_weight
17+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_delivery_carrier__is_manual_weight
18+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__is_manual_weight
19+
msgid "Manual Weights"
20+
msgstr ""
21+
22+
#. module: delivery_carrier_manual_weight
23+
#: model:ir.model,name:delivery_carrier_manual_weight.model_delivery_carrier
24+
msgid "Shipping Methods"
25+
msgstr ""
26+
27+
#. module: delivery_carrier_manual_weight
28+
#: model:ir.model,name:delivery_carrier_manual_weight.model_stock_picking
29+
msgid "Transfer"
30+
msgstr ""
31+
32+
#. module: delivery_carrier_manual_weight
33+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__weight_manual
34+
msgid "Weight (Manual)"
35+
msgstr ""
36+
37+
#. module: delivery_carrier_manual_weight
38+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__shipping_weight_manual
39+
msgid "Weight for Shipping (Manual)"
40+
msgstr ""
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * delivery_carrier_manual_weight
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2024-10-03 11:06+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.6.2\n"
18+
19+
#. module: delivery_carrier_manual_weight
20+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_delivery_carrier__is_manual_weight
21+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__is_manual_weight
22+
msgid "Manual Weights"
23+
msgstr "Pesi manuali"
24+
25+
#. module: delivery_carrier_manual_weight
26+
#: model:ir.model,name:delivery_carrier_manual_weight.model_delivery_carrier
27+
msgid "Shipping Methods"
28+
msgstr "Metodi di spedizione"
29+
30+
#. module: delivery_carrier_manual_weight
31+
#: model:ir.model,name:delivery_carrier_manual_weight.model_stock_picking
32+
msgid "Transfer"
33+
msgstr "Trasferimento"
34+
35+
#. module: delivery_carrier_manual_weight
36+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__weight_manual
37+
msgid "Weight (Manual)"
38+
msgstr "Peso (manuale)"
39+
40+
#. module: delivery_carrier_manual_weight
41+
#: model:ir.model.fields,field_description:delivery_carrier_manual_weight.field_stock_picking__shipping_weight_manual
42+
msgid "Weight for Shipping (Manual)"
43+
msgstr "Peso per spedizione (manuale)"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from . import delivery_carrier
4+
from . import stock_picking
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class DeliveryCarrier(models.Model):
8+
_inherit = "delivery.carrier"
9+
10+
is_manual_weight = fields.Boolean(string="Manual Weights")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, fields, models
5+
6+
7+
class StockPicking(models.Model):
8+
_inherit = "stock.picking"
9+
10+
is_manual_weight = fields.Boolean(related="carrier_id.is_manual_weight")
11+
weight_manual = fields.Float(string="Weight (Manual)", digits="Stock Weight")
12+
shipping_weight_manual = fields.Float(string="Weight for Shipping (Manual)")
13+
14+
@api.depends("move_ids", "carrier_id", "weight_manual")
15+
def _cal_weight(self):
16+
manual_weight = self.filtered(lambda p: p.carrier_id.is_manual_weight)
17+
for rec in manual_weight:
18+
rec.weight = rec.weight_manual
19+
return super(StockPicking, self - manual_weight)._cal_weight()
20+
21+
@api.depends(
22+
"move_line_ids.result_package_id",
23+
"move_line_ids.result_package_id.shipping_weight",
24+
"weight_bulk",
25+
"carrier_id",
26+
"shipping_weight_manual",
27+
)
28+
def _compute_shipping_weight(self):
29+
manual_weight = self.filtered(lambda p: p.carrier_id.is_manual_weight)
30+
for rec in manual_weight:
31+
rec.shipping_weight = rec.shipping_weight_manual
32+
return super(StockPicking, self - manual_weight)._compute_shipping_weight()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- Jordi Masvidal \<<jordi.masvidal@forgeflow.com>\>
2+
- Marina Alapont \<<marina.alapont@forgeflow.com>\>
3+
- Manuel Regidor \<<manuel.regidor@sygel.es>\>
4+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
5+
- Bhavesh Heliconia
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This module adds a flag in Shipping Methods to allow to set manually the
2+
weight and shipping weight in each transfer.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In stock transfers, when using a 'Manual Weights' carrier, two new
2+
fields will be available to fill manually the weight and the shipping
3+
weight.
Loading

0 commit comments

Comments
 (0)