Create module server_environment_delivery
This commit is contained in:
parent
ebae53c142
commit
5e8cac4a94
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
||||
|
|
@ -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"],
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
from . import delivery_carrier
|
||||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
@ -0,0 +1 @@
|
|||
* Akim Juillerat <akim.juillerat@camptocamp.com>
|
||||
|
|
@ -0,0 +1 @@
|
|||
This module allows to configure shipping methods according to server environment.
|
||||
Loading…
Reference in New Issue