Skip to content

Commit 1488190

Browse files
Merge PR #28 into 16.0
Signed-off-by huguesdk
2 parents 712c274 + cbdb9aa commit 1488190

12 files changed

Lines changed: 563 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../website_sale_delivery_product_restriction
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git+https://github.com/coopiteasy/addons@16.0#subdirectory=setup/delivery_product_restriction
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
=========================================
2+
Website Sale Delivery Product Restriction
3+
=========================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:0b373bb3bdfa5915f7fec1ab97dbf50c792f703e9a946a8a5d34e5e06a68d354
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-coopiteasy%2Fcie--e--commerce-lightgray.png?logo=github
20+
:target: https://github.com/coopiteasy/cie-e-commerce/tree/16.0/website_sale_delivery_product_restriction
21+
:alt: coopiteasy/cie-e-commerce
22+
23+
|badge1| |badge2| |badge3|
24+
25+
This is a complement of the module `delivery_product_restriction` to
26+
bring it's features into the eCommerce. It allows some product to be
27+
shipped only by some delivery carrier. If such a product is found in a
28+
SO then the SO can only be shipped via these delivery carrier.
29+
30+
**Table of contents**
31+
32+
.. contents::
33+
:local:
34+
35+
Bug Tracker
36+
===========
37+
38+
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/cie-e-commerce/issues>`_.
39+
In case of trouble, please check there if your issue has already been reported.
40+
If you spotted it first, help us to smash it by providing a detailed and welcomed
41+
`feedback <https://github.com/coopiteasy/cie-e-commerce/issues/new?body=module:%20website_sale_delivery_product_restriction%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
42+
43+
Do not contact contributors directly about support or help with technical issues.
44+
45+
Credits
46+
=======
47+
48+
Authors
49+
~~~~~~~
50+
51+
* Coop IT Easy SC
52+
53+
Contributors
54+
~~~~~~~~~~~~
55+
56+
* `Coop IT Easy SC <https://coopiteasy.be>`_:
57+
58+
* Rémy Taymans
59+
60+
Maintainers
61+
~~~~~~~~~~~
62+
63+
This module is part of the `coopiteasy/cie-e-commerce <https://github.com/coopiteasy/cie-e-commerce/tree/16.0/website_sale_delivery_product_restriction>`_ project on GitHub.
64+
65+
You are welcome to contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2022 Coop IT Easy SC
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Website Sale Delivery Product Restriction",
6+
"summary": (
7+
"Allow some product to be shipped only by some delivery carrier and "
8+
"also on eCommerce"
9+
),
10+
"version": "16.0.1.0.0",
11+
"category": "Website",
12+
"website": "https://coopiteasy.be",
13+
"author": "Coop IT Easy SC",
14+
"license": "AGPL-3",
15+
"depends": [
16+
"delivery_product_restriction",
17+
"website_sale_delivery",
18+
],
19+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * website_sale_delivery_product_restriction
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 12.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: website_sale_delivery_product_restriction
17+
#: model:ir.model,name:website_sale_delivery_product_restriction.model_sale_order
18+
msgid "Sale Order"
19+
msgstr ""
20+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import sale_order
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2022 Coop IT Easy SC
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class SaleOrder(models.Model):
8+
_inherit = "sale.order"
9+
10+
# another way would be to override
11+
# delivery.carrier._is_available_for_order() (defined in the delivery
12+
# module and called by sale.order._get_delivery_methods() in the
13+
# website_sale_delivery module), but this would have to map the products
14+
# for each delivery.carrier, so this is more optimal.
15+
def _get_delivery_methods(self):
16+
products = list(self.order_line.mapped("product_id"))
17+
return (
18+
super()
19+
._get_delivery_methods()
20+
.filtered(lambda c: c._can_be_used_to_deliver_products(products))
21+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* `Coop IT Easy SC <https://coopiteasy.be>`_:
2+
3+
* Rémy Taymans

0 commit comments

Comments
 (0)