forked from OCA/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'refs/pull/3104/head' of https://github.com/oca/sale-wor…
…kflow into 17.0-6867
- Loading branch information
Showing
20 changed files
with
860 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
============================== | ||
Sale Order Carrier Auto Assign | ||
============================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:b5f0ff98a101634f6d21500615b789f2e2cbd6d305d896b93dd77cb31461dec0 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Alpha | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/sale-workflow/tree/17.0/sale_order_carrier_auto_assign | ||
:alt: OCA/sale-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_order_carrier_auto_assign | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module assigns automatically delivery carrier on sale order | ||
confirmation. | ||
|
||
.. IMPORTANT:: | ||
This is an alpha version, the data model and design can change at any time without warning. | ||
Only for development or testing purpose, do not use in production. | ||
`More details on development status <https://odoo-community.org/page/development-status>`_ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To enable sale order carrier auto assign: | ||
|
||
1. Go to *Settings > Sales > Carrier Auto Assign*. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_carrier_auto_assign%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Camptocamp | ||
|
||
Contributors | ||
------------ | ||
|
||
- Akim Juillerat <akim.juillerat@camptocamp.com> | ||
- Son (Ho Dac) <hodacson.6491@gmail.com> | ||
- Phuc (Tran Thanh) <phuc@trobz.com> | ||
- Telmo Santos <telmo.santos@camptocamp.com> | ||
- Tris Doan <tridm@trobz.com> | ||
|
||
Other credits | ||
------------- | ||
|
||
|
||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_order_carrier_auto_assign>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
{ | ||
"name": "Sale Order Carrier Auto Assign", | ||
"summary": "Auto assign delivery carrier on sale order confirmation", | ||
"version": "17.0.1.0.0", | ||
"development_status": "Alpha", | ||
"category": "Operations/Inventory/Delivery", | ||
"website": "https://github.com/OCA/sale-workflow", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"data": ["views/res_config_settings_views.xml"], | ||
"application": False, | ||
"installable": True, | ||
"depends": ["delivery"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_carrier_auto_assign | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2020-10-26 12:08+0000\n" | ||
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.es>\n" | ||
"Language-Team: none\n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 3.10\n" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Assigns automatically delivery carrier on sale order confirmation." | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_company__carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Carrier Auto Assign" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Carrier auto assign" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_company | ||
msgid "Companies" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,help:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Enable carrier auto assign on sale order confirmation." | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "Pedido de venta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_carrier_auto_assign | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-03-18 09:38+0000\n" | ||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Assigns automatically delivery carrier on sale order confirmation." | ||
msgstr "" | ||
"Assegna automaticamente il corriere della consegna alla conferma " | ||
"dell'ordineidi vendita." | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_company__carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Carrier Auto Assign" | ||
msgstr "Auto assegnazione corriere" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Carrier auto assign" | ||
msgstr "Auto assegnazione corriere" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_company | ||
msgid "Companies" | ||
msgstr "Aziende" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "Impostazioni configurazione" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,help:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Enable carrier auto assign on sale order confirmation." | ||
msgstr "" | ||
"Anilita l'auto assegnazione corriere alla conferma dell'ordine di vendita." | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "Ordine di vendita" |
50 changes: 50 additions & 0 deletions
50
sale_order_carrier_auto_assign/i18n/sale_order_carrier_auto_assign.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_carrier_auto_assign | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Assigns automatically delivery carrier on sale order confirmation." | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_company__carrier_auto_assign | ||
#: model:ir.model.fields,field_description:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Carrier Auto Assign" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model_terms:ir.ui.view,arch_db:sale_order_carrier_auto_assign.res_config_settings_view_form_sale | ||
msgid "Carrier auto assign" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_company | ||
msgid "Companies" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model.fields,help:sale_order_carrier_auto_assign.field_res_config_settings__carrier_auto_assign | ||
msgid "Enable carrier auto assign on sale order confirmation." | ||
msgstr "" | ||
|
||
#. module: sale_order_carrier_auto_assign | ||
#: model:ir.model,name:sale_order_carrier_auto_assign.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import sale_order | ||
from . import res_company | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
carrier_auto_assign = fields.Boolean() |
14 changes: 14 additions & 0 deletions
14
sale_order_carrier_auto_assign/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2023 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
carrier_auto_assign = fields.Boolean( | ||
related="company_id.carrier_auto_assign", | ||
readonly=False, | ||
help="Enable carrier auto assign on sale order confirmation.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import models | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
def action_confirm(self): | ||
for rec in self: | ||
if not rec.company_id.carrier_auto_assign: | ||
continue | ||
rec._add_delivery_carrier_on_confirmation() | ||
return super().action_confirm() | ||
|
||
def _add_delivery_carrier_on_confirmation(self): | ||
"""Automatically add delivery.carrier on sale order confirmation""" | ||
for order in self: | ||
if order.delivery_set: | ||
continue | ||
delivery_wiz_action = order.action_open_delivery_wizard() | ||
delivery_wiz_context = delivery_wiz_action.get("context", {}) | ||
if not delivery_wiz_context.get("default_carrier_id"): | ||
continue | ||
delivery_wiz = ( | ||
self.env[delivery_wiz_action.get("res_model")] | ||
.with_context(**delivery_wiz_context) | ||
.create({}) | ||
) | ||
delivery_wiz._get_shipment_rate() | ||
delivery_wiz.button_confirm() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
To enable sale order carrier auto assign: | ||
|
||
1. Go to *Settings \> Sales \> Carrier Auto Assign*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Akim Juillerat \<<akim.juillerat@camptocamp.com>\> | ||
- Son (Ho Dac) \<<hodacson.6491@gmail.com>\> | ||
- Phuc (Tran Thanh) \<<phuc@trobz.com>\> | ||
- Telmo Santos \<<telmo.santos@camptocamp.com>\> | ||
- Tris Doan \<<tridm@trobz.com>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module assigns automatically delivery carrier on sale order | ||
confirmation. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.