Skip to content

Commit 0ca5c63

Browse files
committed
Merge PR #897 into 16.0
Signed-off-by hparfr
2 parents bc0f64c + 12752af commit 0ca5c63

20 files changed

+724
-0
lines changed

delivery_roulier_dpd_fr/README.rst

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
=======================
2+
Delivery Carrier DPD FR
3+
=======================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:a52566f87c06596b2876559ef6c21813d482cdc5180b37512ba8da8f2f6a3d31
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/16.0/delivery_roulier_dpd_fr
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-16-0/delivery-carrier-16-0-delivery_roulier_dpd_fr
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=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Send and track parcels with DPD France.
32+
33+
Products available: 'Classic', 'Predict', and 'Relais'. (previously known as Ici Relais and Exapaq).
34+
35+
**Table of contents**
36+
37+
.. contents::
38+
:local:
39+
40+
Configuration
41+
=============
42+
43+
* company form (Settings > Companies > Companies): complete address of the company, including phone number
44+
45+
* configuration the DPD account informations (Inventory > COnfiguration > Delivery > Carrier Account)
46+
47+
Bug Tracker
48+
===========
49+
50+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/issues>`_.
51+
In case of trouble, please check there if your issue has already been reported.
52+
If you spotted it first, help us to smash it by providing a detailed and welcomed
53+
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_roulier_dpd_fr%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
55+
Do not contact contributors directly about support or help with technical issues.
56+
57+
Credits
58+
=======
59+
60+
Authors
61+
~~~~~~~
62+
63+
* Akretion
64+
65+
Contributors
66+
~~~~~~~~~~~~
67+
68+
* Raphaël REVERDY <raphael.reverdy@akretion.com>
69+
* Florian DA COSTA <florian.dacosta@akretion.com>
70+
* Eric Bouhana <monsieurb@saaslys.com>
71+
72+
Maintainers
73+
~~~~~~~~~~~
74+
75+
This module is maintained by the OCA.
76+
77+
.. image:: https://odoo-community.org/logo.png
78+
:alt: Odoo Community Association
79+
:target: https://odoo-community.org
80+
81+
OCA, or the Odoo Community Association, is a nonprofit organization whose
82+
mission is to support the collaborative development of Odoo features and
83+
promote its widespread use.
84+
85+
.. |maintainer-florian-dacosta| image:: https://github.com/florian-dacosta.png?size=40px
86+
:target: https://github.com/florian-dacosta
87+
:alt: florian-dacosta
88+
89+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
90+
91+
|maintainer-florian-dacosta|
92+
93+
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/16.0/delivery_roulier_dpd_fr>`_ project on GitHub.
94+
95+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

delivery_roulier_dpd_fr/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
{
4+
"name": "Delivery Carrier DPD FR",
5+
"version": "16.0.1.0.0",
6+
"author": "Akretion, Odoo Community Association (OCA)",
7+
"summary": "Generate Labels for DPD",
8+
"category": "Warehouse",
9+
"maintainers": ["florian-dacosta"],
10+
"depends": [
11+
"delivery_roulier",
12+
],
13+
"website": "https://github.com/OCA/delivery-carrier",
14+
"data": [
15+
"views/carrier_account_views.xml",
16+
"data/product.product.xml",
17+
"data/delivery_carrier.xml",
18+
],
19+
"demo": [
20+
"demo/carrier_account.xml",
21+
],
22+
"external_dependencies": {
23+
"python": [
24+
"cerberus",
25+
],
26+
},
27+
"installable": True,
28+
"license": "AGPL-3",
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
4+
<record id="delivery_carrier_dpd_classic" model="delivery.carrier">
5+
<field name="name">DPD Classic max 30kg</field>
6+
<field name="delivery_type">dpd_fr_soap</field>
7+
<field name="code">DPD_Classic</field>
8+
<field name="product_id" ref="dpd_product" />
9+
</record>
10+
11+
<record id="delivery_carrier_dpd_Relais" model="delivery.carrier">
12+
<field name="name">DPD Relais max 20kg</field>
13+
<field name="product_id" ref="dpd_product" />
14+
<field name="code">DPD_Relais</field>
15+
<field name="delivery_type">dpd_fr_soap</field>
16+
</record>
17+
18+
<record id="delivery_carrier_dpd_Predict" model="delivery.carrier">
19+
<field name="name">DPD Predict max 20kg</field>
20+
<field name="product_id" ref="dpd_product" />
21+
<field name="code">DPD_Predict</field>
22+
<field name="delivery_type">dpd_fr_soap</field>
23+
</record>
24+
25+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
4+
<record id="dpd_product" model="product.product">
5+
<field name="default_code">SHIP_DPD</field>
6+
<field name="type">service</field>
7+
<field name="name">Coûts de livraison - DPD</field>
8+
</record>
9+
10+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
4+
<record id="demo_carrier_account_dpd" model="carrier.account">
5+
<field name="name">Dpd default</field>
6+
<field name="account">Demo Account</field>
7+
<field name="password">Demo password</field>
8+
<field name="delivery_type">dpd_fr_soap</field>
9+
</record>
10+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from . import stock_picking
2+
from . import delivery_carrier
3+
from . import stock_quant_package
4+
from . import carrier_account
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
4+
from odoo import fields, models
5+
6+
7+
class CarrierAccount(models.Model):
8+
_inherit = "carrier.account"
9+
10+
dpd_fr_soap_customer_country = fields.Char()
11+
dpd_fr_soap_customer_id = fields.Char(string="DPD Customer ID")
12+
dpd_fr_soap_agency_id = fields.Char(string="DPD Agency ID")
13+
dpd_fr_soap_file_format = fields.Selection(
14+
[("ZPL", "ZPL"), ("PDF", "PDF")], string="DPD file format"
15+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from odoo import fields, models
4+
5+
6+
class DeliveryCarrier(models.Model):
7+
_inherit = "delivery.carrier"
8+
9+
delivery_type = fields.Selection(
10+
selection_add=[("dpd_fr_soap", "DPD")],
11+
ondelete={"dpd_fr_soap": "set default"},
12+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from odoo import models
4+
5+
6+
class StockPicking(models.Model):
7+
_inherit = "stock.picking"
8+
9+
def _dpd_fr_soap_get_service(self, account, package=None):
10+
service = self._roulier_get_service(account, package=package)
11+
service.update(
12+
{
13+
"customerCountry": account.dpd_fr_soap_customer_country,
14+
"customerId": account.dpd_fr_soap_customer_id,
15+
"agencyId": account.dpd_fr_soap_agency_id,
16+
"reference1": self.sale_id.name or self.origin or self.name,
17+
}
18+
)
19+
if self.carrier_code == "DPD_Relais":
20+
service["pickupLocationId"] = self._dpd_dropoff_site()
21+
service["notifications"] = "AutomaticSMS"
22+
if self.carrier_code == "DPD_Predict":
23+
service["notifications"] = "Predict"
24+
return service
25+
26+
def _dpd_dropoff_site(self):
27+
self.ensure_one()
28+
return "" # like P22895 TODO implement this
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from odoo import models
4+
5+
6+
class StockQuantPackage(models.Model):
7+
_inherit = "stock.quant.package"
8+
9+
def _dpd_fr_soap_get_tracking_link(self):
10+
return "http://www.dpd.fr/traces_%s" % self.parcel_tracking
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* company form (Settings > Companies > Companies): complete address of the company, including phone number
2+
3+
* configuration the DPD account informations (Inventory > COnfiguration > Delivery > Carrier Account)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* Raphaël REVERDY <raphael.reverdy@akretion.com>
2+
* Florian DA COSTA <florian.dacosta@akretion.com>
3+
* Eric Bouhana <monsieurb@saaslys.com>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Send and track parcels with DPD France.
2+
3+
Products available: 'Classic', 'Predict', and 'Relais'. (previously known as Ici Relais and Exapaq).
Loading

0 commit comments

Comments
 (0)