diff --git a/stock_picking_partner_note/README.rst b/stock_picking_partner_note/README.rst new file mode 100644 index 000000000000..b1dca34f14c7 --- /dev/null +++ b/stock_picking_partner_note/README.rst @@ -0,0 +1,96 @@ +========================== +Stock Picking Partner Note +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f95766f575f6b83457b2b0d305d7506a2be1f61adfe5eb9f8581aff1fa377bb9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fstock--logistics--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_partner_note + :alt: OCA/stock-logistics-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_partner_note + :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/stock-logistics-workflow&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allow to record a message for the person in charge of order preparation +at the level of the customer, then have it as a note on the picking +transfer. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +- Create partner note types in Inventory > Configuration > Note Types. +- In shipping operation types set field Partner Note Type. Only these + types will be shown in picking operations notes. +- On contacts add picking notes. + +You can prevent users ot update or delete notes alredy in use by +multiple customers by activating setting Prevent update or delete of +notes in use by multiple customers in Inventory > Configuration > +Settings. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp +* BCIM + +Contributors +------------ + +- Telmo Santos +- Jacques-Etienne Baudoux +- `360ERP `__: + + - Andrea Stirpe + +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/stock-logistics-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_partner_note/__init__.py b/stock_picking_partner_note/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/stock_picking_partner_note/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_picking_partner_note/__manifest__.py b/stock_picking_partner_note/__manifest__.py new file mode 100644 index 000000000000..ca12d2c88531 --- /dev/null +++ b/stock_picking_partner_note/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Stock Picking Partner Note", + "version": "17.0.1.0.0", + "development_status": "Beta", + "category": "Product", + "summary": "Add partner notes on picking", + "author": "Camptocamp, BCIM, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-workflow", + "license": "AGPL-3", + "depends": ["sale_stock"], + "data": [ + "security/ir.model.access.csv", + "views/res_partner.xml", + "views/stock_picking_note_type.xml", + "views/stock_picking_type.xml", + "views/stock_picking_note.xml", + "views/stock_picking_partner_note_menus.xml", + "views/res_config_settings.xml", + ], + "installable": True, + "auto_install": False, +} diff --git a/stock_picking_partner_note/i18n/fr.po b/stock_picking_partner_note/i18n/fr.po new file mode 100644 index 000000000000..2c7eb8435121 --- /dev/null +++ b/stock_picking_partner_note/i18n/fr.po @@ -0,0 +1,189 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_partner_note +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-05 10:49+0000\n" +"PO-Revision-Date: 2024-02-05 10:49+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__active +msgid "Active" +msgstr "" + +#. module: stock_picking_partner_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.res_config_settings_view_form +msgid "" +"Add a constraint to check if the picking note is already in use on multiple " +"partner" +msgstr "" +"Ajout d'une contrainte pour vérifier si la note de prélèvement est déjà " +"utilisée par plusieurs partenaires" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_company__check_note_already_in_use +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "Check picking note already in use" +msgstr "Vérifier la note de prélèvement déjà utilisée" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_company +msgid "Companies" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__display_name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__id +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__id +msgid "ID" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note____last_update +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__name +msgid "Name" +msgstr "Nom" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__note_type_id +msgid "Note Type" +msgstr "Type de note" + +#. module: stock_picking_partner_note +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_note_types_menu +msgid "Note Types" +msgstr "Type de notes" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking__note +msgid "Notes" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "Partner Note Type" +msgstr "Type de note partenaire" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_form +msgid "Picking Note" +msgstr "Note d'opération" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note_type +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_type_form +msgid "Picking Note Type" +msgstr "Opération Type de note" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_partner__stock_picking_note_ids +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_users__stock_picking_note_ids +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_notes_root +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_partner_form_inherit +msgid "Picking Notes" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_type +msgid "Picking Type" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__sequence +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__sequence +msgid "Sequence" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.actions.act_window,name:stock_picking_partner_note.stock_picking_note_types_act_window +msgid "Stock Picking Note Types" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "" +"That must be activated if you want to prevent the update or deletion of a " +"note that is already in use by multiple contacts." +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "" +"Type of note with customer preferences on how his products are prepared for " +"delivery." +msgstr "" + +#. module: stock_picking_partner_note +#. odoo-python +#: code:addons/stock_picking_partner_note/models/stock_picking_note.py:0 +#, python-format +msgid "" +"You cannot update or delete a note that linked to multiple contacts: " +"%(partner_ids)s" +msgstr "" +"Vous ne pouvez pas mettre à jour ou supprimer une note liée à plusieurs " +"contacts." + +#~ msgid "Picking Note Types" +#~ msgstr "Opération Types de note" diff --git a/stock_picking_partner_note/i18n/it.po b/stock_picking_partner_note/i18n/it.po new file mode 100644 index 000000000000..70a1093c83aa --- /dev/null +++ b/stock_picking_partner_note/i18n/it.po @@ -0,0 +1,190 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_partner_note +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-22 10:06+0000\n" +"Last-Translator: mymage \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 5.6.2\n" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__active +msgid "Active" +msgstr "Attiva" + +#. module: stock_picking_partner_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.res_config_settings_view_form +msgid "" +"Add a constraint to check if the picking note is already in use on multiple " +"partner" +msgstr "" +"Aggiungere un vincolo per verificare se la nota del prelievo è già in uso su " +"più partner" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_company__check_note_already_in_use +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "Check picking note already in use" +msgstr "Contollo nota prelievo già in uso" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__display_name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__id +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__id +msgid "ID" +msgstr "ID" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note____last_update +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__name +msgid "Name" +msgstr "Nome" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__note_type_id +msgid "Note Type" +msgstr "Tipo nota" + +#. module: stock_picking_partner_note +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_note_types_menu +msgid "Note Types" +msgstr "Tipi nota" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking__note +msgid "Notes" +msgstr "Note" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "Partner Note Type" +msgstr "Tipo nota pertner" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_form +msgid "Picking Note" +msgstr "Nota prelievo" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note_type +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_type_form +msgid "Picking Note Type" +msgstr "Tipo nota prelievo" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_partner__stock_picking_note_ids +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_users__stock_picking_note_ids +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_notes_root +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_partner_form_inherit +msgid "Picking Notes" +msgstr "Note prelievo" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_type +msgid "Picking Type" +msgstr "Tipo prelievo" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__sequence +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__sequence +msgid "Sequence" +msgstr "Sequenza" + +#. module: stock_picking_partner_note +#: model:ir.actions.act_window,name:stock_picking_partner_note.stock_picking_note_types_act_window +msgid "Stock Picking Note Types" +msgstr "Tipi nota prelievo magazzino" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "" +"That must be activated if you want to prevent the update or deletion of a " +"note that is already in use by multiple contacts." +msgstr "" +"Questo deve essere attivato se si vuole prevenire la modifica o la " +"cancellazione di una nota che è già in uso da più contatti." + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking +msgid "Transfer" +msgstr "Trasferimento" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "" +"Type of note with customer preferences on how his products are prepared for " +"delivery." +msgstr "" +"Tipo nota con preferenze cliente su come i suoi prodotti sono preparati per " +"la spedizione." + +#. module: stock_picking_partner_note +#. odoo-python +#: code:addons/stock_picking_partner_note/models/stock_picking_note.py:0 +#, python-format +msgid "" +"You cannot update or delete a note that linked to multiple contacts: " +"%(partner_ids)s" +msgstr "" +"Non si può modificare o cancellare una nota che è collegata a più contatti: " +"%(partner_ids)s" diff --git a/stock_picking_partner_note/i18n/stock_picking_partner_note.pot b/stock_picking_partner_note/i18n/stock_picking_partner_note.pot new file mode 100644 index 000000000000..3c977959f812 --- /dev/null +++ b/stock_picking_partner_note/i18n/stock_picking_partner_note.pot @@ -0,0 +1,179 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_partner_note +# +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: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__active +msgid "Active" +msgstr "" + +#. module: stock_picking_partner_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.res_config_settings_view_form +msgid "" +"Add a constraint to check if the picking note is already in use on multiple " +"partner" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_company__check_note_already_in_use +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "Check picking note already in use" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_company +msgid "Companies" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__create_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__display_name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__id +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__id +msgid "ID" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note____last_update +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_uid +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__write_date +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__name +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__name +msgid "Name" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__note_type_id +msgid "Note Type" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_note_types_menu +msgid "Note Types" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking__note +msgid "Notes" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "Partner Note Type" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_form +msgid "Picking Note" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_note_type +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_type_form +msgid "Picking Note Type" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_partner__stock_picking_note_ids +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_res_users__stock_picking_note_ids +#: model:ir.ui.menu,name:stock_picking_partner_note.stock_picking_notes_root +#: model_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_partner_form_inherit +msgid "Picking Notes" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking_type +msgid "Picking Type" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note__sequence +#: model:ir.model.fields,field_description:stock_picking_partner_note.field_stock_picking_note_type__sequence +msgid "Sequence" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.actions.act_window,name:stock_picking_partner_note.stock_picking_note_types_act_window +msgid "Stock Picking Note Types" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_res_config_settings__check_note_already_in_use +msgid "" +"That must be activated if you want to prevent the update or deletion of a " +"note that is already in use by multiple contacts." +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model,name:stock_picking_partner_note.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: stock_picking_partner_note +#: model:ir.model.fields,help:stock_picking_partner_note.field_stock_picking_type__partner_note_type_ids +msgid "" +"Type of note with customer preferences on how his products are prepared for " +"delivery." +msgstr "" + +#. module: stock_picking_partner_note +#. odoo-python +#: code:addons/stock_picking_partner_note/models/stock_picking_note.py:0 +#, python-format +msgid "" +"You cannot update or delete a note that linked to multiple contacts: " +"%(partner_ids)s" +msgstr "" diff --git a/stock_picking_partner_note/models/__init__.py b/stock_picking_partner_note/models/__init__.py new file mode 100644 index 000000000000..3a2047306a5b --- /dev/null +++ b/stock_picking_partner_note/models/__init__.py @@ -0,0 +1,7 @@ +from . import stock_picking_note_type +from . import stock_picking_note +from . import stock_picking_type +from . import stock_picking +from . import res_partner +from . import res_company +from . import res_config_settings diff --git a/stock_picking_partner_note/models/res_company.py b/stock_picking_partner_note/models/res_company.py new file mode 100644 index 000000000000..fdc0133f3b64 --- /dev/null +++ b/stock_picking_partner_note/models/res_company.py @@ -0,0 +1,13 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + check_note_already_in_use = fields.Boolean( + string="Check picking note already in use", + default=False, + ) diff --git a/stock_picking_partner_note/models/res_config_settings.py b/stock_picking_partner_note/models/res_config_settings.py new file mode 100644 index 000000000000..794a6f8a2895 --- /dev/null +++ b/stock_picking_partner_note/models/res_config_settings.py @@ -0,0 +1,15 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + check_note_already_in_use = fields.Boolean( + related="company_id.check_note_already_in_use", + readonly=False, + help="Prevent the update or deletion of a note that is already in use by " + "more than one contact.", + ) diff --git a/stock_picking_partner_note/models/res_partner.py b/stock_picking_partner_note/models/res_partner.py new file mode 100644 index 000000000000..439e070d85c9 --- /dev/null +++ b/stock_picking_partner_note/models/res_partner.py @@ -0,0 +1,14 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + stock_picking_note_ids = fields.Many2many( + comodel_name="stock.picking.note", + string="Picking Notes", + ) diff --git a/stock_picking_partner_note/models/stock_picking.py b/stock_picking_partner_note/models/stock_picking.py new file mode 100644 index 000000000000..ca0add34e3c6 --- /dev/null +++ b/stock_picking_partner_note/models/stock_picking.py @@ -0,0 +1,26 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.tools import html_escape + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + note = fields.Html(compute="_compute_note", store=True) + + @api.depends("partner_id") + def _compute_note(self): + for picking in self: + picking_type_note_type_ids = picking.picking_type_id.partner_note_type_ids + picking_notes = picking.partner_id.stock_picking_note_ids.filtered( + lambda n, ptnts=picking_type_note_type_ids: n.active + and n.note_type_id in ptnts + ) + picking_notes = [ + html_escape(note.name.strip()) + for note in picking_notes + if note.name and note.name.strip() + ] + picking.note = "
".join(picking_notes) diff --git a/stock_picking_partner_note/models/stock_picking_note.py b/stock_picking_partner_note/models/stock_picking_note.py new file mode 100644 index 000000000000..5ebfbf51489b --- /dev/null +++ b/stock_picking_partner_note/models/stock_picking_note.py @@ -0,0 +1,39 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + + +class StockPickingNote(models.Model): + _name = "stock.picking.note" + _description = "Picking Note" + _order = "sequence,name" + + name = fields.Text(required=True) + active = fields.Boolean(default=True) + note_type_id = fields.Many2one("stock.picking.note.type", required=True) + sequence = sequence = fields.Integer(related="note_type_id.sequence", store=True) + + def write(self, vals): + self.check_note_already_in_use() + return super().write(vals) + + @api.ondelete(at_uninstall=False) + def check_note_already_in_use(self): + if not self.env.user.company_id.check_note_already_in_use: + return True + for note in self: + partners = self.env["res.partner"].search( + [("stock_picking_note_ids", "in", note.ids)] + ) + if len(partners) > 1: + raise UserError( + _( + "You cannot update or delete a note that is linked to multiple" + " contacts: %(partner_ids)s", + partner_ids=", ".join(partners.mapped("name")), + ) + ) + return True diff --git a/stock_picking_partner_note/models/stock_picking_note_type.py b/stock_picking_partner_note/models/stock_picking_note_type.py new file mode 100644 index 000000000000..10d5988d4b2e --- /dev/null +++ b/stock_picking_partner_note/models/stock_picking_note_type.py @@ -0,0 +1,14 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from odoo import fields, models + + +class StockPickingNoteType(models.Model): + _name = "stock.picking.note.type" + _description = "Picking Note Type" + _order = "sequence,name" + + sequence = fields.Integer() + name = fields.Char(required=True) diff --git a/stock_picking_partner_note/models/stock_picking_type.py b/stock_picking_partner_note/models/stock_picking_type.py new file mode 100644 index 000000000000..291f18f6cb51 --- /dev/null +++ b/stock_picking_partner_note/models/stock_picking_type.py @@ -0,0 +1,15 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from odoo import fields, models + + +class StockPickingType(models.Model): + _inherit = "stock.picking.type" + + partner_note_type_ids = fields.Many2many( + "stock.picking.note.type", + help="Type of note with customer preferences on how his products are prepared " + "for delivery.", + ) diff --git a/stock_picking_partner_note/pyproject.toml b/stock_picking_partner_note/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/stock_picking_partner_note/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_picking_partner_note/readme/CONFIGURE.md b/stock_picking_partner_note/readme/CONFIGURE.md new file mode 100644 index 000000000000..40be90e324cb --- /dev/null +++ b/stock_picking_partner_note/readme/CONFIGURE.md @@ -0,0 +1,9 @@ +- Create partner note types in Inventory \> Configuration \> Note Types. +- In shipping operation types set field Partner Note Type. Only these + types will be shown in picking operations notes. +- On contacts add picking notes. + +You can prevent users from updating or deleting notes already in use by +multiple customers by activating setting Prevent update or delete of +notes in use by multiple customers in Inventory \> Configuration \> +Settings. diff --git a/stock_picking_partner_note/readme/CONTRIBUTORS.md b/stock_picking_partner_note/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..77dda21fcce0 --- /dev/null +++ b/stock_picking_partner_note/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Telmo Santos \<\> +- Jacques-Etienne Baudoux \<\> +- [360ERP](https://www.360erp.com): + - Andrea Stirpe diff --git a/stock_picking_partner_note/readme/DESCRIPTION.md b/stock_picking_partner_note/readme/DESCRIPTION.md new file mode 100644 index 000000000000..b06393ff2588 --- /dev/null +++ b/stock_picking_partner_note/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +Allow to record a message for the person in charge of order preparation +at the level of the customer, then have it as a note on the picking +transfer. This reuses the existing note field on the picking and will make it read-only. diff --git a/stock_picking_partner_note/security/ir.model.access.csv b/stock_picking_partner_note/security/ir.model.access.csv new file mode 100644 index 000000000000..920562ef3a3b --- /dev/null +++ b/stock_picking_partner_note/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_picking_note_type_manager,stock.picking.note.type manager,model_stock_picking_note_type,stock.group_stock_manager,1,1,1,1 +access_stock_picking_note_user,stock.picking.note user,model_stock_picking_note,sales_team.group_sale_salesman,1,1,1,1 diff --git a/stock_picking_partner_note/static/description/icon.png b/stock_picking_partner_note/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_picking_partner_note/static/description/icon.png differ diff --git a/stock_picking_partner_note/static/description/index.html b/stock_picking_partner_note/static/description/index.html new file mode 100644 index 000000000000..96d2b397e196 --- /dev/null +++ b/stock_picking_partner_note/static/description/index.html @@ -0,0 +1,442 @@ + + + + + +Stock Picking Partner Note + + + +
+

Stock Picking Partner Note

+ + +

Beta License: AGPL-3 OCA/stock-logistics-workflow Translate me on Weblate Try me on Runboat

+

Allow to record a message for the person in charge of order preparation +at the level of the customer, then have it as a note on the picking +transfer.

+

Table of contents

+ +
+

Configuration

+
    +
  • Create partner note types in Inventory > Configuration > Note Types.
  • +
  • In shipping operation types set field Partner Note Type. Only these +types will be shown in picking operations notes.
  • +
  • On contacts add picking notes.
  • +
+

You can prevent users ot update or delete notes alredy in use by +multiple customers by activating setting Prevent update or delete of +notes in use by multiple customers in Inventory > Configuration > +Settings.

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
  • BCIM
  • +
+
+
+

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/stock-logistics-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/stock_picking_partner_note/tests/__init__.py b/stock_picking_partner_note/tests/__init__.py new file mode 100644 index 000000000000..b25c719d4f0a --- /dev/null +++ b/stock_picking_partner_note/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_picking_partner_note diff --git a/stock_picking_partner_note/tests/test_stock_picking_partner_note.py b/stock_picking_partner_note/tests/test_stock_picking_partner_note.py new file mode 100644 index 000000000000..fdb0fab5f8f5 --- /dev/null +++ b/stock_picking_partner_note/tests/test_stock_picking_partner_note.py @@ -0,0 +1,68 @@ +# Copyright 2024 Camptocamp (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.exceptions import UserError +from odoo.tests import Form, common + +from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + + +class StockPickingPartnerNote(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env["base"].with_context(**DISABLED_MAIL_CONTEXT).env + cls.product_a = cls.env.ref("product.product_product_4") + cls.note_type1 = cls.env["stock.picking.note.type"].create( + {"name": "Note type 1", "sequence": 10} + ) + cls.note_type2 = cls.env["stock.picking.note.type"].create( + {"name": "Note type 2", "sequence": 20} + ) + cls.partner_a = cls.env["res.partner"].create( + { + "name": "Customer A", + "stock_picking_note_ids": [ + (0, 0, {"name": "Note 1 ", "note_type_id": cls.note_type1.id}), + (0, 0, {"name": "Note 2", "note_type_id": cls.note_type2.id}), + (0, 0, {"name": " ", "note_type_id": cls.note_type2.id}), + ], + } + ) + + def test_picking_partner_note(self): + with Form(self.env["sale.order"]) as order_form: + order_form.partner_id = self.partner_a + with order_form.order_line.new() as line_form: + line_form.product_id = self.product_a + line_form.product_uom_qty = 1 + + self.order = order_form.save() + self.order.warehouse_id.out_type_id.partner_note_type_ids = [ + (6, 0, (self.note_type1 | self.note_type2).ids) + ] + self.order.action_confirm() + self.assertIn("

Note 1
Note 2

", self.order.picking_ids[0].note) + + def test_no_check_note_already_in_use(self): + self.assertTrue( + self.partner_a.stock_picking_note_ids.check_note_already_in_use() + ) + + def test_picking_partner_note_already_in_use(self): + """Test that we cannot update or delete a note that is already in use.""" + self.env.user.company_id.check_note_already_in_use = True + partner_b = self.env["res.partner"].create( + { + "name": "Customer B", + "stock_picking_note_ids": [ + (4, self.partner_a.stock_picking_note_ids[0].id), + ], + } + ) + # We cannot update a note that is already in use + with self.assertRaises(UserError): + partner_b.stock_picking_note_ids.write({"name": "Changed Note"}) + # We cannot delete a note that is already in use + with self.assertRaises(UserError): + partner_b.stock_picking_note_ids.unlink() diff --git a/stock_picking_partner_note/views/res_config_settings.xml b/stock_picking_partner_note/views/res_config_settings.xml new file mode 100644 index 000000000000..a4bd1239d53b --- /dev/null +++ b/stock_picking_partner_note/views/res_config_settings.xml @@ -0,0 +1,22 @@ + + + + res.config.settings.view.form + res.config.settings + + + + + + + + + + diff --git a/stock_picking_partner_note/views/res_partner.xml b/stock_picking_partner_note/views/res_partner.xml new file mode 100644 index 000000000000..81cb99253248 --- /dev/null +++ b/stock_picking_partner_note/views/res_partner.xml @@ -0,0 +1,29 @@ + + + + res.partner.form.inherit + res.partner + + + + + + + + + + + + + + + diff --git a/stock_picking_partner_note/views/stock_picking_note.xml b/stock_picking_partner_note/views/stock_picking_note.xml new file mode 100644 index 000000000000..20c27c0a979a --- /dev/null +++ b/stock_picking_partner_note/views/stock_picking_note.xml @@ -0,0 +1,16 @@ + + + + stock.picking.note.form + stock.picking.note + +
+ + + + + +
+
+
+
diff --git a/stock_picking_partner_note/views/stock_picking_note_type.xml b/stock_picking_partner_note/views/stock_picking_note_type.xml new file mode 100644 index 000000000000..8000067f196b --- /dev/null +++ b/stock_picking_partner_note/views/stock_picking_note_type.xml @@ -0,0 +1,33 @@ + + + + stock.picking.note.type.tree + stock.picking.note.type + + + + + + + + + + stock.picking.note.type.form + stock.picking.note.type + +
+ + + +
+
+
+ + + Stock Picking Note Types + stock.picking.note.type + tree,form + [] + {} + +
diff --git a/stock_picking_partner_note/views/stock_picking_partner_note_menus.xml b/stock_picking_partner_note/views/stock_picking_partner_note_menus.xml new file mode 100644 index 000000000000..aea41f86d48a --- /dev/null +++ b/stock_picking_partner_note/views/stock_picking_partner_note_menus.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/stock_picking_partner_note/views/stock_picking_type.xml b/stock_picking_partner_note/views/stock_picking_type.xml new file mode 100644 index 000000000000..4dea63854fbe --- /dev/null +++ b/stock_picking_partner_note/views/stock_picking_type.xml @@ -0,0 +1,13 @@ + + + + Operation Types + stock.picking.type + + + + + + + +