Create module server_environment_delivery

This commit is contained in:
Akim Juillerat 2020-07-24 11:44:27 +02:00
parent ebae53c142
commit 5e8cac4a94
7 changed files with 52 additions and 0 deletions

View File

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

View File

@ -0,0 +1,15 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Server Environment Delivery",
"summary": "Configure prod environment for delivery carriers",
"version": "13.0.1.0.0",
"development_status": "Alpha",
"category": "Operations/Inventory/Delivery",
"website": "https://github.com/OCA/server-env",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["delivery", "server_environment"],
}

View File

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

View File

@ -0,0 +1,15 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import models
class DeliveryCarrier(models.Model):
_name = "delivery.carrier"
_inherit = ["delivery.carrier", "server.env.mixin"]
@property
def _server_env_fields(self):
base_fields = super()._server_env_fields
delivery_fields = {"prod_environment": {}}
delivery_fields.update(base_fields)
return delivery_fields

View File

@ -0,0 +1,18 @@
At the moment, the module only allows to define the field prod_environment by
defining a `[delivery_carrier]` with `prod_environment` key as follows:
Restrict usage of prod environment:
```
[delivery_carrier]
prod_environment=False
```
Force usage of prod environment:
```
[delivery_carrier]
prod_environment=False
```
If the key is not set, the user will still be able to switch the value.

View File

@ -0,0 +1 @@
* Akim Juillerat <akim.juillerat@camptocamp.com>

View File

@ -0,0 +1 @@
This module allows to configure shipping methods according to server environment.