Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] sale_order_carrier_auto_assign: Migration to 17.0 #3104

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7185127
Create module sale_order_carrier_auto_assign
grindtildeath Aug 4, 2020
9ea9733
Use context key to avoid breaking other modules tests
grindtildeath Aug 5, 2020
6e05e83
[UPD] Update sale_order_carrier_auto_assign.pot
oca-travis Aug 17, 2020
2c9612b
[UPD] README.rst
OCA-git-bot Aug 17, 2020
0e9c4fe
[ADD] icon.png
OCA-git-bot Aug 17, 2020
314c851
Compute shipping rate on carrier auto-assign
guewen Aug 19, 2020
1c6cd8f
sale_order_carrier_auto_assign 13.0.1.1.0
OCA-git-bot Aug 19, 2020
c7fff8d
Added translation using Weblate (Spanish)
danimv5 Oct 26, 2020
6e5557c
Translated using Weblate (Spanish)
danimv5 Oct 26, 2020
d3a00ee
[MIG] sale_order_carrier_auto_assign: Migration to 14.0
phuctranfxvn Jan 11, 2021
65550dd
[UPD] Update sale_order_carrier_auto_assign.pot
oca-travis Aug 9, 2021
6339fd7
[UPD] README.rst
OCA-git-bot Aug 9, 2021
9e8d43d
sale_order_carrier_auto_assign 14.0.1.0.1
OCA-git-bot Aug 9, 2021
92eee47
[UPD] README.rst
OCA-git-bot Jun 2, 2022
b98ac03
[UPD] README.rst
OCA-git-bot Jun 2, 2022
c908902
[MIG] sale_order_carrier_auto_assign: Migration to 15.0
vib-adhoc Aug 26, 2022
a23be16
[UPD] Update sale_order_carrier_auto_assign.pot
Sep 29, 2022
47cb7ad
[UPD] README.rst
OCA-git-bot Sep 29, 2022
12b41ec
sale_order_carrier_auto_assign 15.0.1.0.1
OCA-git-bot Sep 29, 2022
966d6a3
[MIG] sale_order_carrier_auto_assign: Migration to 16.0
matiasperalta1 May 30, 2023
aeddf14
[UPD] Update sale_order_carrier_auto_assign.pot
Jan 27, 2024
47a2600
[BOT] post-merge updates
OCA-git-bot Jan 27, 2024
ef48570
Added translation using Weblate (Italian)
mymage Feb 1, 2024
62601f4
Translated using Weblate (Italian)
mymage Feb 1, 2024
0e39eaa
[IMP] sale_order_carrier_auto_assigni: add settings
santostelmo Dec 7, 2023
654ffc9
[IMP] sale_order_carrier_auto_assign multi-company
trisdoan Feb 23, 2024
f584c80
[UPD] Update sale_order_carrier_auto_assign.pot
Mar 11, 2024
fffa61d
[BOT] post-merge updates
OCA-git-bot Mar 11, 2024
cb98d09
Update translation files
weblate Mar 11, 2024
5cfc124
Translated using Weblate (Italian)
mymage Mar 18, 2024
c272089
[IMP] sale_order_carrier_auto_assign: pre-commit auto fixes
lef-adhoc Apr 26, 2024
83a456f
[MIG] sale_order_carrier_auto_assign: Migration to 17.0
lef-adhoc Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions sale_order_carrier_auto_assign/README.rst
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 <[email protected]>
- Son (Ho Dac) <[email protected]>
- Phuc (Tran Thanh) <[email protected]>
- Telmo Santos <[email protected]>
- Tris Doan <[email protected]>

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.
1 change: 1 addition & 0 deletions sale_order_carrier_auto_assign/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions sale_order_carrier_auto_assign/__manifest__.py
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"],
}
53 changes: 53 additions & 0 deletions sale_order_carrier_auto_assign/i18n/es.po
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 <[email protected]>\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"
56 changes: 56 additions & 0 deletions sale_order_carrier_auto_assign/i18n/it.po
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 <[email protected]>\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"
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 ""
3 changes: 3 additions & 0 deletions sale_order_carrier_auto_assign/models/__init__.py
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
10 changes: 10 additions & 0 deletions sale_order_carrier_auto_assign/models/res_company.py
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 sale_order_carrier_auto_assign/models/res_config_settings.py
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.",
)
31 changes: 31 additions & 0 deletions sale_order_carrier_auto_assign/models/sale_order.py
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

Check warning on line 20 in sale_order_carrier_auto_assign/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

sale_order_carrier_auto_assign/models/sale_order.py#L20

Added line #L20 was not covered by tests
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()
3 changes: 3 additions & 0 deletions sale_order_carrier_auto_assign/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions sale_order_carrier_auto_assign/readme/CONFIGURE.md
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*.
5 changes: 5 additions & 0 deletions sale_order_carrier_auto_assign/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Akim Juillerat \<<[email protected]>\>
- Son (Ho Dac) \<<[email protected]>\>
- Phuc (Tran Thanh) \<<[email protected]>\>
- Telmo Santos \<<[email protected]>\>
- Tris Doan \<<[email protected]>\>
1 change: 1 addition & 0 deletions sale_order_carrier_auto_assign/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions sale_order_carrier_auto_assign/readme/DESCRIPTION.md
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.
Loading
Loading