diff --git a/delivery_auto_refresh/README.rst b/delivery_auto_refresh/README.rst new file mode 100644 index 0000000000..d63c4c1928 --- /dev/null +++ b/delivery_auto_refresh/README.rst @@ -0,0 +1,116 @@ +===================== +Auto-refresh delivery +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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%2Fdelivery--carrier-lightgray.png?logo=github + :target: https://github.com/OCA/delivery-carrier/tree/13.0/delivery_auto_refresh + :alt: OCA/delivery-carrier +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-delivery_auto_refresh + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/99/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module automates the delivery price handling for the following cases: + +* If you change any line in your draft sales order (SO), when saving, the + delivery price will be adjusted without having to click on "→ Set price". +* If specified in the system parameter, the delivery line can be also + auto-added when creating/saving. +* If you deliver a different quantity than the ordered one, the delivery price + is adjusted on the linked SO when the picking is transferred. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* Activate developer mode. +* Go to *Settings > Technical > Parameters > System Parameters*. +* Locate the setting with key "delivery_auto_refresh.auto_add_delivery_line" + or create a new one if not exists. + Put a non Falsy value (1, True...) if you want to add automatically the + delivery line on save. +* Locate the setting with key "delivery_auto_refresh.refresh_after_picking" + or create a new one if not exists. + Put a non Falsy value (1, True...) if you want to refresh delivery price + after transferring. +* Locate the setting with key "delivery_auto_refresh.auto_void_delivery_line" + or create a new one if it doesn't exists. + Put a non Falsy value (1, True...) if you want to void the delivery line + values (price, units ordered, units delivered) in the sale order when the + delivered picking is returned to refund prior to be invoiced. + +Known issues / Roadmap +====================== + +* After confirming the sales order, the price of the delivery line (if exists) + will be only updated after the picking is transferred, but not when you + might modify the order lines. +* There can be some duplicate delivery unset/set for assuring that the refresh + is done on all cases. +* On multiple deliveries, second and successive pickings update the delivery + price, but you can't invoice the new delivery price. +* This is only working from user interface, as there's no way of making + compatible the auto-refresh intercepting create/write methods from sale order + lines. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Tecnativa : + * Pedro M. Baeza + * Vicent Cubells + * Carlos Roca + +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/delivery-carrier `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_auto_refresh/__init__.py b/delivery_auto_refresh/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/delivery_auto_refresh/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/delivery_auto_refresh/__manifest__.py b/delivery_auto_refresh/__manifest__.py new file mode 100644 index 0000000000..0072e38e54 --- /dev/null +++ b/delivery_auto_refresh/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Auto-refresh delivery", + "summary": "Auto-refresh delivery price in sales orders", + "version": "14.0.1.0.0", + "category": "Delivery", + "website": "https://github.com/OCA/delivery-carrier", + "author": "Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["delivery"], + "data": ["data/ir_config_parameter.xml", "views/sale_order_views.xml"], +} diff --git a/delivery_auto_refresh/data/ir_config_parameter.xml b/delivery_auto_refresh/data/ir_config_parameter.xml new file mode 100644 index 0000000000..be0ee84b9c --- /dev/null +++ b/delivery_auto_refresh/data/ir_config_parameter.xml @@ -0,0 +1,21 @@ + + + + + delivery_auto_refresh.set_default_carrier + 0 + + + delivery_auto_refresh.auto_add_delivery_line + 0 + + + delivery_auto_refresh.refresh_after_picking + 0 + + + delivery_auto_refresh.auto_void_delivery_line + 0 + + diff --git a/delivery_auto_refresh/i18n/ca.po b/delivery_auto_refresh/i18n/ca.po new file mode 100644 index 0000000000..2910ef21e6 --- /dev/null +++ b/delivery_auto_refresh/i18n/ca.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Transferència" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Comandes de venda" diff --git a/delivery_auto_refresh/i18n/cs_CZ.po b/delivery_auto_refresh/i18n/cs_CZ.po new file mode 100644 index 0000000000..4280cf0a5f --- /dev/null +++ b/delivery_auto_refresh/i18n/cs_CZ.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Převod" diff --git a/delivery_auto_refresh/i18n/de.po b/delivery_auto_refresh/i18n/de.po new file mode 100644 index 0000000000..44005f8329 --- /dev/null +++ b/delivery_auto_refresh/i18n/de.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Umbuchung" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Verkaufsauftrag" diff --git a/delivery_auto_refresh/i18n/delivery_auto_refresh.pot b/delivery_auto_refresh/i18n/delivery_auto_refresh.pot new file mode 100644 index 0000000000..8f810fb8ff --- /dev/null +++ b/delivery_auto_refresh/i18n/delivery_auto_refresh.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/delivery_auto_refresh/i18n/el_GR.po b/delivery_auto_refresh/i18n/el_GR.po new file mode 100644 index 0000000000..e9d4516722 --- /dev/null +++ b/delivery_auto_refresh/i18n/el_GR.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" +"el_GR/)\n" +"Language: el_GR\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Εντολή Πώλησης" diff --git a/delivery_auto_refresh/i18n/es.po b/delivery_auto_refresh/i18n/es.po new file mode 100644 index 0000000000..c96ab824e5 --- /dev/null +++ b/delivery_auto_refresh/i18n/es.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Pedido de venta" diff --git a/delivery_auto_refresh/i18n/es_ES.po b/delivery_auto_refresh/i18n/es_ES.po new file mode 100644 index 0000000000..2d56afd274 --- /dev/null +++ b/delivery_auto_refresh/i18n/es_ES.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/" +"es_ES/)\n" +"Language: es_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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Pedido de venta" diff --git a/delivery_auto_refresh/i18n/es_VE.po b/delivery_auto_refresh/i18n/es_VE.po new file mode 100644 index 0000000000..7b2df603cc --- /dev/null +++ b/delivery_auto_refresh/i18n/es_VE.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (Venezuela) (https://www.transifex.com/oca/" +"teams/23907/es_VE/)\n" +"Language: es_VE\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Pedidos de venta" diff --git a/delivery_auto_refresh/i18n/fi.po b/delivery_auto_refresh/i18n/fi.po new file mode 100644 index 0000000000..bec9946981 --- /dev/null +++ b/delivery_auto_refresh/i18n/fi.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Myyntitilaus" diff --git a/delivery_auto_refresh/i18n/fr.po b/delivery_auto_refresh/i18n/fr.po new file mode 100644 index 0000000000..43940d9438 --- /dev/null +++ b/delivery_auto_refresh/i18n/fr.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Transférer" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Bon de commande" diff --git a/delivery_auto_refresh/i18n/gl.po b/delivery_auto_refresh/i18n/gl.po new file mode 100644 index 0000000000..0def410eef --- /dev/null +++ b/delivery_auto_refresh/i18n/gl.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"Language: gl\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Transferencia" diff --git a/delivery_auto_refresh/i18n/hr.po b/delivery_auto_refresh/i18n/hr.po new file mode 100644 index 0000000000..be4ea823e4 --- /dev/null +++ b/delivery_auto_refresh/i18n/hr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Prodajni nalog" diff --git a/delivery_auto_refresh/i18n/hr_HR.po b/delivery_auto_refresh/i18n/hr_HR.po new file mode 100644 index 0000000000..1cf0e1edee --- /dev/null +++ b/delivery_auto_refresh/i18n/hr_HR.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Prodjani nalog" diff --git a/delivery_auto_refresh/i18n/hu.po b/delivery_auto_refresh/i18n/hu.po new file mode 100644 index 0000000000..3e39e5b3b8 --- /dev/null +++ b/delivery_auto_refresh/i18n/hu.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Hungarian (https://www.transifex.com/oca/teams/23907/hu/)\n" +"Language: hu\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Vevői megrendelés" diff --git a/delivery_auto_refresh/i18n/it.po b/delivery_auto_refresh/i18n/it.po new file mode 100644 index 0000000000..171f48c48f --- /dev/null +++ b/delivery_auto_refresh/i18n/it.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Trasferisci" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Ordini vendita" diff --git a/delivery_auto_refresh/i18n/nl.po b/delivery_auto_refresh/i18n/nl.po new file mode 100644 index 0000000000..9f6a0ab145 --- /dev/null +++ b/delivery_auto_refresh/i18n/nl.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Verkooporder" diff --git a/delivery_auto_refresh/i18n/nl_NL.po b/delivery_auto_refresh/i18n/nl_NL.po new file mode 100644 index 0000000000..a2dbab05b6 --- /dev/null +++ b/delivery_auto_refresh/i18n/nl_NL.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# Peter Hageman , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: Peter Hageman , 2018\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Verkooporder" diff --git a/delivery_auto_refresh/i18n/pt.po b/delivery_auto_refresh/i18n/pt.po new file mode 100644 index 0000000000..cca8df4976 --- /dev/null +++ b/delivery_auto_refresh/i18n/pt.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Ordem de Venda" diff --git a/delivery_auto_refresh/i18n/pt_BR.po b/delivery_auto_refresh/i18n/pt_BR.po new file mode 100644 index 0000000000..cadfc8fefd --- /dev/null +++ b/delivery_auto_refresh/i18n/pt_BR.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2019-09-09 14:24+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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.8\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#~ msgid "Sale Order" +#~ msgstr "Ordem de Venda" diff --git a/delivery_auto_refresh/i18n/ro.po b/delivery_auto_refresh/i18n/ro.po new file mode 100644 index 0000000000..8010f97698 --- /dev/null +++ b/delivery_auto_refresh/i18n/ro.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Comandă vânzare" diff --git a/delivery_auto_refresh/i18n/sl.po b/delivery_auto_refresh/i18n/sl.po new file mode 100644 index 0000000000..ae65bdcb1e --- /dev/null +++ b/delivery_auto_refresh/i18n/sl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2020-08-11 15:00+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "Premestitev" + +#~ msgid "Sale Order" +#~ msgstr "Prodajni nalog" diff --git a/delivery_auto_refresh/i18n/tr.po b/delivery_auto_refresh/i18n/tr.po new file mode 100644 index 0000000000..2a7d26e28a --- /dev/null +++ b/delivery_auto_refresh/i18n/tr.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Sipariş Emri" diff --git a/delivery_auto_refresh/i18n/tr_TR.po b/delivery_auto_refresh/i18n/tr_TR.po new file mode 100644 index 0000000000..15d5112d0d --- /dev/null +++ b/delivery_auto_refresh/i18n/tr_TR.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\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" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Satış emri" diff --git a/delivery_auto_refresh/i18n/vi_VN.po b/delivery_auto_refresh/i18n/vi_VN.po new file mode 100644 index 0000000000..e5cd473203 --- /dev/null +++ b/delivery_auto_refresh/i18n/vi_VN.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2018-03-13 03:45+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "" + +#, fuzzy +#~ msgid "Sale Order" +#~ msgstr "Đơn hàng Bán" diff --git a/delivery_auto_refresh/i18n/zh_CN.po b/delivery_auto_refresh/i18n/zh_CN.po new file mode 100644 index 0000000000..6ea13b79b9 --- /dev/null +++ b/delivery_auto_refresh/i18n/zh_CN.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_auto_refresh +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-13 03:45+0000\n" +"PO-Revision-Date: 2019-09-07 11:23+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,field_description:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Delivery Method" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model.fields,help:delivery_auto_refresh.field_sale_order__carrier_id +msgid "Fill this field if you plan to invoice the shipping based on picking." +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: delivery_auto_refresh +#: model:ir.model,name:delivery_auto_refresh.model_stock_picking +msgid "Transfer" +msgstr "调拨" + +#~ msgid "Sale Order" +#~ msgstr "销售订单" diff --git a/delivery_auto_refresh/models/__init__.py b/delivery_auto_refresh/models/__init__.py new file mode 100644 index 0000000000..c0b4257cf6 --- /dev/null +++ b/delivery_auto_refresh/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale_order +from . import stock_picking diff --git a/delivery_auto_refresh/models/sale_order.py b/delivery_auto_refresh/models/sale_order.py new file mode 100644 index 0000000000..0b431e77cd --- /dev/null +++ b/delivery_auto_refresh/models/sale_order.py @@ -0,0 +1,143 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2021 Tecnativa - Carlos Roca +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + +from ..utils import get_bool_param + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + available_carrier_ids = fields.Many2many( + comodel_name="delivery.carrier", + compute="_compute_available_carrier_ids", + ) + + @api.onchange("partner_id", "partner_shipping_id") + def _onchange_partner_id(self): + if hasattr(super(), "_onchange_partner_id"): + super()._onchange_partner_id() + if get_bool_param(self.env, "set_default_carrier"): + for order in self: + action = order.action_open_delivery_wizard() + carrier_id = self.env["delivery.carrier"].browse( + action["context"]["default_carrier_id"] + ) + # If the carrier isn't allowed for the current shipping address, we wont + # default to it. In that case we'd try to fallback to the former carrier. + order.carrier_id = fields.first( + (carrier_id | order.carrier_id).filtered( + lambda x: x in order.available_carrier_ids._origin + ) + ) + + @api.depends("partner_shipping_id") + def _compute_available_carrier_ids(self): + """We want to apply the same carriers filter in the header as in the wizard""" + for sale in self: + wizard = self.env["choose.delivery.carrier"].new({"order_id": sale.id}) + sale.available_carrier_ids = wizard.available_carrier_ids._origin + + def _get_param_auto_add_delivery_line(self): + # When we have the context 'website_id' it means that we are doing the order from + # e-commerce. So we don't want to add the delivery line automatically. + if self.env.context.get("website_id"): + return False + return get_bool_param(self.env, "auto_add_delivery_line") + + def _auto_refresh_delivery(self): + self.ensure_one() + # Make sure that if you have removed the carrier, the line is gone + if self._get_param_auto_add_delivery_line(): + if self.state in {"draft", "sent"}: + # Context added to avoid the recursive calls and save the new + # value of carrier_id + self.with_context(auto_refresh_delivery=True)._remove_delivery_line() + if self._get_param_auto_add_delivery_line() and self.carrier_id: + if self.state in {"draft", "sent"}: + price_unit = self.carrier_id.rate_shipment(self)["price"] + self._create_delivery_line(self.carrier_id, price_unit) + self.with_context(auto_refresh_delivery=True).write( + {"recompute_delivery_price": False} + ) + + @api.model + def create(self, vals): + """Create or refresh delivery line on create.""" + order = super().create(vals) + order._auto_refresh_delivery() + return order + + def write(self, vals): + """Create or refresh delivery line after saving.""" + res = super().write(vals) + if self._get_param_auto_add_delivery_line() and not self.env.context.get( + "auto_refresh_delivery" + ): + for order in self: + delivery_line = order.order_line.filtered("is_delivery") + order.with_context( + delivery_discount=delivery_line[-1:].discount, + )._auto_refresh_delivery() + return res + + def _create_delivery_line(self, carrier, price_unit): + """Allow users to keep discounts to delivery lines. Unit price will + be recomputed anyway""" + sol = super()._create_delivery_line(carrier, price_unit) + discount = self.env.context.get("delivery_discount") + if discount and sol: + sol.discount = discount + return sol + + def set_delivery_line(self, carrier, amount): + if self._get_param_auto_add_delivery_line() and self.state in {"draft", "sent"}: + self.carrier_id = carrier.id + else: + return super().set_delivery_line(carrier, amount) + + def _remove_delivery_line(self): + current_carrier = self.carrier_id + super()._remove_delivery_line() + self.carrier_id = current_carrier + + def _is_delivery_line_voidable(self): + """If the picking is returned before being invoiced, like when the picking + is delivered but immediately return because the customer refused the order, + so no delivery charges should be applied.""" + # There are invoiceable lines so there's no full return or the lines + # were not set to refund. + qty_delivered = sum( + self.order_line.filtered( + lambda x: not x.is_delivery and x.product_id.type != "service" + ).mapped("qty_delivered") + ) + # There must be validated pickings + pickings = self.picking_ids.filtered(lambda x: x.state == "done") + # If there aren't delivery lines or the order is a quotation there's + # nothing to be done either. If there are more than one delivery lines + # we won't be doing anything as well. + if ( + self.state not in {"done", "sale"} + or self.invoice_ids + or not self.order_line.filtered("is_delivery") + or len(self.order_line.filtered("is_delivery")) > 1 + or qty_delivered + or not pickings + ): + return False + return True + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + def _get_protected_fields(self): + """Avoid locked orders validation error when voiding the + delivery line""" + fields = super()._get_protected_fields() + if self.env.context.get("delivery_auto_refresh_override_locked"): + return [x for x in fields if x not in ["product_uom_qty", "price_unit"]] + return fields diff --git a/delivery_auto_refresh/models/stock_picking.py b/delivery_auto_refresh/models/stock_picking.py new file mode 100644 index 0000000000..6cbe9cc059 --- /dev/null +++ b/delivery_auto_refresh/models/stock_picking.py @@ -0,0 +1,68 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + +from ..utils import get_bool_param + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + def _add_delivery_cost_to_so(self): + """Update delivery price in SO from picking data.""" + res = super()._add_delivery_cost_to_so() + if not get_bool_param(self.env, "refresh_after_picking"): + return res + self.ensure_one() + sale_order = self.sale_id + if not sale_order or not self.carrier_id: # pragma: no cover + return res + so_line = sale_order.order_line.filtered(lambda x: x.is_delivery)[:1] + if not so_line: # pragma: no cover + return res + total = weight = volume = quantity = 0 + for move_line in self.move_line_ids.filtered("qty_done"): + if not move_line.product_id: + continue + move = move_line.move_id + qty = move.product_uom._compute_quantity( + move_line.qty_done, + move_line.product_id.uom_id, + ) + weight += (move_line.product_id.weight or 0.0) * qty + volume += (move_line.product_id.volume or 0.0) * qty + quantity += qty + total += move.sale_line_id.price_unit * qty + total = sale_order.currency_id._convert( + total, + sale_order.company_id.currency_id, + sale_order.company_id, + sale_order.date_order, + ) + so_line.price_unit = self.carrier_id._get_price_from_picking( + total, + weight, + volume, + quantity, + ) + return res + + def _action_done(self): + res = super()._action_done() + # If configured, we want to set to 0 automatically the delivery line + # when we have a returned picking that isn't invoiced so we don't have + # it as invoiceable line. Otherwise, the salesman has to do it by hand. + if not get_bool_param(self.env, "auto_void_delivery_line"): + return res + sales_to_void_delivery = self.filtered( + lambda x: x.sale_id + and x.picking_type_code == "incoming" + and x.sale_id._is_delivery_line_voidable() + ).mapped("sale_id") + sales_to_void_delivery.mapped("order_line").filtered( + lambda x: x.is_delivery + ).with_context(delivery_auto_refresh_override_locked=True).write( + {"qty_delivered": 0, "product_uom_qty": 0, "price_unit": 0} + ) + return res diff --git a/delivery_auto_refresh/readme/CONFIGURE.rst b/delivery_auto_refresh/readme/CONFIGURE.rst new file mode 100644 index 0000000000..dab0baaba0 --- /dev/null +++ b/delivery_auto_refresh/readme/CONFIGURE.rst @@ -0,0 +1,19 @@ +* Activate developer mode. +* Go to *Settings > Technical > Parameters > System Parameters*. +* Locate the setting with key "delivery_auto_refresh.set_default_carrier" + or create a new one if not exists. + Put a non Falsy value (1, True...) if you want to have default carrier computed + automatically. +* Locate the setting with key "delivery_auto_refresh.auto_add_delivery_line" + or create a new one if not exists. + Put a non Falsy value (1, True...) if you want to add automatically the + delivery line on save. +* Locate the setting with key "delivery_auto_refresh.refresh_after_picking" + or create a new one if not exists. + Put a non Falsy value (1, True...) if you want to refresh delivery price + after transferring. +* Locate the setting with key "delivery_auto_refresh.auto_void_delivery_line" + or create a new one if it doesn't exists. + Put a non Falsy value (1, True...) if you want to void the delivery line + values (price, units ordered, units delivered) in the sale order when the + delivered picking is returned to refund prior to be invoiced. diff --git a/delivery_auto_refresh/readme/CONTRIBUTORS.rst b/delivery_auto_refresh/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..a38909d38a --- /dev/null +++ b/delivery_auto_refresh/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* Tecnativa : + * Pedro M. Baeza + * Vicent Cubells + * Carlos Roca + +* Camptocamp : + * Maksym Yankin + * Simone Orsi diff --git a/delivery_auto_refresh/readme/DESCRIPTION.rst b/delivery_auto_refresh/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..a7c8207958 --- /dev/null +++ b/delivery_auto_refresh/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module automates the delivery price handling for the following cases: + +* If you change any line in your draft sales order (SO), when saving, the + delivery price will be adjusted without having to click on "→ Set price". +* If specified in the system parameter, the delivery line can be also + auto-added when creating/saving. +* If you deliver a different quantity than the ordered one, the delivery price + is adjusted on the linked SO when the picking is transferred. diff --git a/delivery_auto_refresh/readme/ROADMAP.rst b/delivery_auto_refresh/readme/ROADMAP.rst new file mode 100644 index 0000000000..7a7d2a7098 --- /dev/null +++ b/delivery_auto_refresh/readme/ROADMAP.rst @@ -0,0 +1,10 @@ +* After confirming the sales order, the price of the delivery line (if exists) + will be only updated after the picking is transferred, but not when you + might modify the order lines. +* There can be some duplicate delivery unset/set for assuring that the refresh + is done on all cases. +* On multiple deliveries, second and successive pickings update the delivery + price, but you can't invoice the new delivery price. +* This is only working from user interface, as there's no way of making + compatible the auto-refresh intercepting create/write methods from sale order + lines. diff --git a/delivery_auto_refresh/static/description/icon.png b/delivery_auto_refresh/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/delivery_auto_refresh/static/description/icon.png differ diff --git a/delivery_auto_refresh/static/description/index.html b/delivery_auto_refresh/static/description/index.html new file mode 100644 index 0000000000..61acf797c9 --- /dev/null +++ b/delivery_auto_refresh/static/description/index.html @@ -0,0 +1,467 @@ + + + + + + +Auto-refresh delivery + + + +
+

Auto-refresh delivery

+ + +

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

+

This module automates the delivery price handling for the following cases:

+
    +
  • If you change any line in your draft sales order (SO), when saving, the +delivery price will be adjusted without having to click on “→ Set price”.
  • +
  • If specified in the system parameter, the delivery line can be also +auto-added when creating/saving.
  • +
  • If you deliver a different quantity than the ordered one, the delivery price +is adjusted on the linked SO when the picking is transferred.
  • +
+

Table of contents

+ +
+

Configuration

+
    +
  • Activate developer mode.
  • +
  • Go to Settings > Technical > Parameters > System Parameters.
  • +
  • Locate the setting with key “delivery_auto_refresh.auto_add_delivery_line” +or create a new one if not exists. +Put a non Falsy value (1, True…) if you want to add automatically the +delivery line on save.
  • +
  • Locate the setting with key “delivery_auto_refresh.refresh_after_picking” +or create a new one if not exists. +Put a non Falsy value (1, True…) if you want to refresh delivery price +after transferring.
  • +
  • Locate the setting with key “delivery_auto_refresh.auto_void_delivery_line” +or create a new one if it doesn’t exists. +Put a non Falsy value (1, True…) if you want to void the delivery line +values (price, units ordered, units delivered) in the sale order when the +delivered picking is returned to refund prior to be invoiced.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • After confirming the sales order, the price of the delivery line (if exists) +will be only updated after the picking is transferred, but not when you +might modify the order lines.
  • +
  • There can be some duplicate delivery unset/set for assuring that the refresh +is done on all cases.
  • +
  • On multiple deliveries, second and successive pickings update the delivery +price, but you can’t invoice the new delivery price.
  • +
  • This is only working from user interface, as there’s no way of making +compatible the auto-refresh intercepting create/write methods from sale order +lines.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/delivery-carrier project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/delivery_auto_refresh/tests/__init__.py b/delivery_auto_refresh/tests/__init__.py new file mode 100644 index 0000000000..455b4c5814 --- /dev/null +++ b/delivery_auto_refresh/tests/__init__.py @@ -0,0 +1 @@ +from . import test_delivery_auto_refresh diff --git a/delivery_auto_refresh/tests/test_delivery_auto_refresh.py b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py new file mode 100644 index 0000000000..9d7c4a8762 --- /dev/null +++ b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py @@ -0,0 +1,271 @@ +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests import Form, common, tagged + + +def _execute_onchanges(records, field_name): + """Helper methods that executes all onchanges associated to a field.""" + for onchange in records._onchange_methods.get(field_name, []): + for record in records: + onchange(record) + + +@tagged("post_install", "-at_install") +class TestDeliveryAutoRefresh(common.SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + service = cls.env["product.product"].create( + {"name": "Service Test", "type": "service"} + ) + pricelist = cls.env["product.pricelist"].create( + {"name": "Test pricelist", "currency_id": cls.env.company.currency_id.id} + ) + carrier_form = Form(cls.env["delivery.carrier"]) + carrier_form.name = "Test carrier 1" + carrier_form.delivery_type = "base_on_rule" + carrier_form.product_id = service + with carrier_form.price_rule_ids.new() as price_rule_form: + price_rule_form.variable = "weight" + price_rule_form.operator = "<=" + price_rule_form.max_value = 20 + price_rule_form.list_base_price = 50 + with carrier_form.price_rule_ids.new() as price_rule_form: + price_rule_form.variable = "weight" + price_rule_form.operator = "<=" + price_rule_form.max_value = 40 + price_rule_form.list_base_price = 30 + price_rule_form.list_price = 1 + price_rule_form.variable_factor = "weight" + with carrier_form.price_rule_ids.new() as price_rule_form: + price_rule_form.variable = "weight" + price_rule_form.operator = ">" + price_rule_form.max_value = 40 + price_rule_form.list_base_price = 20 + price_rule_form.list_price = 1.5 + price_rule_form.variable_factor = "weight" + cls.carrier_1 = carrier_form.save() + carrier_form = Form(cls.env["delivery.carrier"]) + carrier_form.name = "Test carrier 2" + carrier_form.delivery_type = "base_on_rule" + carrier_form.product_id = service + with carrier_form.price_rule_ids.new() as price_rule_form: + price_rule_form.variable = "weight" + price_rule_form.operator = "<=" + price_rule_form.max_value = 20 + price_rule_form.list_base_price = 50 + cls.carrier_2 = carrier_form.save() + cls.product = cls.env["product.product"].create( + {"name": "Test product", "weight": 10, "list_price": 20} + ) + cls.partner = cls.env["res.partner"].create( + { + "name": "Test partner", + "property_delivery_carrier_id": cls.carrier_1.id, + "property_product_pricelist": pricelist.id, + } + ) + cls.param_name1 = "delivery_auto_refresh.auto_add_delivery_line" + cls.param_name2 = "delivery_auto_refresh.refresh_after_picking" + cls.param_name3 = "delivery_auto_refresh.auto_void_delivery_line" + order_form = Form(cls.env["sale.order"]) + order_form.partner_id = cls.partner + order_form.partner_invoice_id = cls.partner + order_form.partner_shipping_id = cls.partner + with order_form.order_line.new() as ol_form: + ol_form.product_id = cls.product + ol_form.product_uom_qty = 2 + cls.order = order_form.save() + + def test_auto_refresh_so(self): + self.assertFalse(self.order.order_line.filtered("is_delivery")) + self.env["ir.config_parameter"].sudo().set_param(self.param_name1, 1) + self.order.write( + {"order_line": [(1, self.order.order_line.id, {"product_uom_qty": 3})]} + ) + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.price_unit, 60) + line2 = self.order.order_line.new( + { + "order_id": self.order.id, + "product_id": self.product.id, + "product_uom_qty": 2, + } + ) + _execute_onchanges(line2, "product_id") + vals = line2._convert_to_write(line2._cache) + del vals["order_id"] + self.order.write({"order_line": [(0, 0, vals)]}) + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.price_unit, 95) + # Test saving the discount + line_delivery.discount = 10 + self.order.carrier_id = self.carrier_2 + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.discount, 10) + # Test change the carrier_id using the wizard + wiz = Form( + self.env["choose.delivery.carrier"].with_context( + { + "default_order_id": self.order.id, + "default_carrier_id": self.carrier_1.id, + } + ) + ).save() + wiz.button_confirm() + self.assertEqual(self.order.carrier_id, self.carrier_1) + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.name, "Test carrier 1") + + def test_auto_refresh_picking(self): + self.env["ir.config_parameter"].sudo().set_param(self.param_name2, 1) + self.order.order_line.product_uom_qty = 3 + wiz = Form( + self.env["choose.delivery.carrier"].with_context( + { + "default_order_id": self.order.id, + "default_carrier_id": self.carrier_1.id, + } + ) + ).save() + wiz.button_confirm() + self.order.action_confirm() + picking = self.order.picking_ids + picking.action_assign() + picking.move_line_ids[0].qty_done = 2 + picking._action_done() + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.price_unit, 50) + + def test_no_auto_refresh_picking(self): + self.env["ir.config_parameter"].sudo().set_param(self.param_name2, "0") + self.order.order_line.product_uom_qty = 3 + wiz = Form( + self.env["choose.delivery.carrier"].with_context( + { + "default_order_id": self.order.id, + "default_carrier_id": self.carrier_1.id, + } + ) + ).save() + wiz.button_confirm() + self.order.action_confirm() + picking = self.order.picking_ids + picking.action_assign() + picking.move_line_ids[0].qty_done = 2 + picking._action_done() + line_delivery = self.order.order_line.filtered("is_delivery") + self.assertEqual(line_delivery.price_unit, 60) + + def test_compute_carrier_id(self): + order_form_1 = Form(self.env["sale.order"]) + order_form_1.partner_id = self.partner + self.assertEqual(order_form_1.carrier_id, self.carrier_1) + partner_without_carrier = self.env["res.partner"].create( + { + "name": "Test partner without carrier", + "property_delivery_carrier_id": False, + } + ) + no_carrier = self.env["delivery.carrier"] + order_form_2 = Form(self.env["sale.order"]) + order_form_2.partner_id = partner_without_carrier + self.assertEquals(order_form_2.carrier_id, no_carrier) + + def _confirm_sale_order(self, order): + sale_form = Form(order) + # Force the delivery line creation + with sale_form.order_line.edit(0) as line_form: + line_form.product_uom_qty = 2 + sale_form.save() + line_delivery = order.order_line.filtered("is_delivery") + order.action_confirm() + return line_delivery + + def _validate_picking(self, picking): + """Helper method to confirm the pickings""" + for line in picking.move_lines: + line.quantity_done = line.product_uom_qty + picking._action_done() + + def _return_whole_picking(self, picking, to_refund=True): + """Helper method to create a return of the original picking. It could + be refundable or not""" + return_wiz_form = Form( + self.env["stock.return.picking"].with_context( + active_ids=picking.ids, + active_id=picking[:1].id, + active_model="stock.picking", + ) + ) + return_wiz = return_wiz_form.save() + return_wiz.product_return_moves.quantity = picking.move_lines.quantity_done + return_wiz.product_return_moves.to_refund = to_refund + # import pdb; pdb.set_trace() + res = return_wiz.create_returns() + return_picking = self.env["stock.picking"].browse(res["res_id"]) + self._validate_picking(return_picking) + + def _test_autorefresh_void_line(self, lock=False, to_refund=True, invoice=False): + """Helper method to test the possible cases for voiding the line""" + self.assertFalse(self.order.order_line.filtered("is_delivery")) + self.env["ir.config_parameter"].sudo().set_param(self.param_name1, 1) + self.env["ir.config_parameter"].sudo().set_param(self.param_name3, 1) + line_delivery = self._confirm_sale_order(self.order) + self._validate_picking(self.order.picking_ids) + if invoice: + self.order._create_invoices() + if lock: + self.order.action_done() + self._return_whole_picking(self.order.picking_ids, to_refund) + return line_delivery + + def test_auto_refresh_so_and_return_no_invoiced(self): + """The delivery line is voided as all conditions apply when the return + is made""" + line_delivery = self._test_autorefresh_void_line() + self.assertEqual(line_delivery.price_unit, 0) + self.assertEqual(line_delivery.product_uom_qty, 0) + + def test_auto_refresh_so_and_return_no_invoiced_locked(self): + """The delivery line is voided as all conditions apply when the return + is made. We overrided the locked state in this case""" + line_delivery = self._test_autorefresh_void_line(lock=True) + self.assertEqual(line_delivery.price_unit, 0) + self.assertEqual(line_delivery.product_uom_qty, 0) + + def test_auto_refresh_so_and_return_invoiced(self): + """There's already an invoice, so the delivery line can't be voided""" + line_delivery = self._test_autorefresh_void_line(invoice=True) + self.assertEqual(line_delivery.price_unit, 50) + self.assertEqual(line_delivery.product_uom_qty, 1) + + def test_auto_refresh_so_and_return_no_refund(self): + """The return wasn't flagged to refund, so the delivered qty won't + change, thus the delivery line shouldn't be either""" + line_delivery = self._test_autorefresh_void_line(to_refund=False) + self.assertEqual(line_delivery.price_unit, 50) + self.assertEqual(line_delivery.product_uom_qty, 1) + + def _test_autorefresh_unlink_line(self): + """Helper method to test the possible cases for voiding the line""" + self.assertFalse(self.order.order_line.filtered("is_delivery")) + self.env["ir.config_parameter"].sudo().set_param(self.param_name1, 1) + sale_form = Form(self.order) + # Force the delivery line creation + with sale_form.order_line.edit(0) as line_form: + line_form.product_uom_qty = 2 + sale_form.save() + return self.order.order_line.filtered("is_delivery") + + def test_auto_refresh_so_and_unlink_line(self): + """The return wasn't flagged to refund, so the delivered qty won't + change, thus the delivery line shouldn't be either""" + self._test_autorefresh_unlink_line() + delivery_line = self.order.order_line.filtered("is_delivery") + sale_form = Form(self.order) + sale_form.order_line.remove(0) + sale_form.save() + self.assertFalse(delivery_line.exists()) diff --git a/delivery_auto_refresh/utils.py b/delivery_auto_refresh/utils.py new file mode 100644 index 0000000000..d2b4d44e51 --- /dev/null +++ b/delivery_auto_refresh/utils.py @@ -0,0 +1,10 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tools.misc import str2bool + + +def get_bool_param(env, name, default="0"): + get_param = env["ir.config_parameter"].sudo().get_param + param = "delivery_auto_refresh." + name + return str2bool(get_param(param, ""), default=default) diff --git a/delivery_auto_refresh/views/sale_order_views.xml b/delivery_auto_refresh/views/sale_order_views.xml new file mode 100644 index 0000000000..1f0ede1df6 --- /dev/null +++ b/delivery_auto_refresh/views/sale_order_views.xml @@ -0,0 +1,19 @@ + + + + delivery.sale.order.form.show.carrier + sale.order + + + + + + + + + + + diff --git a/delivery_carrier_pricelist/tests/test_delivery_pricelist.py b/delivery_carrier_pricelist/tests/test_delivery_pricelist.py index a89909c041..14aef19f41 100644 --- a/delivery_carrier_pricelist/tests/test_delivery_pricelist.py +++ b/delivery_carrier_pricelist/tests/test_delivery_pricelist.py @@ -92,20 +92,15 @@ def test_wizard_invoice_policy(self): def test_wizard_send_shipping(self): self.create_price_list() self.create_wizard() - price = self.pricelist_item.fixed_price self.carrier_pricelist.invoice_policy = "pricelist" delivery_wizard = self.delivery_wizard delivery_wizard.carrier_id = self.carrier_pricelist - rec = delivery_wizard.save() - rec.button_confirm() so = self.sale_normal_delivery_charges so.action_confirm() - self.assertEqual(so.carrier_id, delivery_wizard.carrier_id) link = delivery_wizard.carrier_id.get_tracking_link(so.picking_ids) self.assertFalse(link) result = delivery_wizard.carrier_id.send_shipping(so.picking_ids) - expecting = [{"exact_price": price, "tracking_number": False}] - self.assertEqual(result, expecting) + self.assertEqual(result, [{"exact_price": 0.0, "tracking_number": False}]) def test_fields_view_get(self): carrier = self.carrier_pricelist diff --git a/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh b/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh new file mode 120000 index 0000000000..a5d845fd1b --- /dev/null +++ b/setup/delivery_auto_refresh/odoo/addons/delivery_auto_refresh @@ -0,0 +1 @@ +../../../../delivery_auto_refresh \ No newline at end of file diff --git a/setup/delivery_auto_refresh/setup.py b/setup/delivery_auto_refresh/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/delivery_auto_refresh/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)