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 <https://github.com/OCA/stock-logistics-workflow/issues>`_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_partner_note%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp +* BCIM + +Contributors +------------ + +- Telmo Santos <telmo.santos@camptocamp.com> +- Jacques-Etienne Baudoux <je@bcim.be> +- `360ERP <https://www.360erp.com>`__: + + - 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 <https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_partner_note>`_ 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 (<https://www.camptocamp.com>). +# 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 <stefano.consolaro@mymage.it>\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 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 (<https://www.camptocamp.com>). +# 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 (<https://www.camptocamp.com>). +# 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 (<https://www.camptocamp.com>). +# 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 (<https://www.camptocamp.com>). +# 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 = "<br />".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 (<https://www.camptocamp.com>). +# 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 (<https://www.camptocamp.com>). +# 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 (<https://www.camptocamp.com>). +# 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 \<<telmo.santos@camptocamp.com>\> +- Jacques-Etienne Baudoux \<<je@bcim.be>\> +- [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 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> +<title>Stock Picking Partner Note</title> +<style type="text/css"> + +/* +:Author: David Goodger (goodger@python.org) +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ + +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { + border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { + /* Override more specific margin styles with "! important". */ + margin-top: 0 ! important } + +.last, .with-subtitle { + margin-bottom: 0 ! important } + +.hidden { + display: none } + +.subscript { + vertical-align: sub; + font-size: smaller } + +.superscript { + vertical-align: super; + font-size: smaller } + +a.toc-backref { + text-decoration: none ; + color: black } + +blockquote.epigraph { + margin: 2em 5em ; } + +dl.docutils dd { + margin-bottom: 0.5em } + +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + +/* Uncomment (and remove this text!) to get bold-faced definition list terms +dl.docutils dt { + font-weight: bold } +*/ + +div.abstract { + margin: 2em 5em } + +div.abstract p.topic-title { + font-weight: bold ; + text-align: center } + +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title, .code .error { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } + +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } + +div.figure { + margin-left: 2em ; + margin-right: 2em } + +div.footer, div.header { + clear: both; + font-size: smaller } + +div.line-block { + display: block ; + margin-top: 1em ; + margin-bottom: 1em } + +div.line-block div.line-block { + margin-top: 0 ; + margin-bottom: 0 ; + margin-left: 1.5em } + +div.sidebar { + margin: 0 0 0.5em 1em ; + border: medium outset ; + padding: 1em ; + background-color: #ffffee ; + width: 40% ; + float: right ; + clear: right } + +div.sidebar p.rubric { + font-family: sans-serif ; + font-size: medium } + +div.system-messages { + margin: 5em } + +div.system-messages h1 { + color: red } + +div.system-message { + border: medium outset ; + padding: 1em } + +div.system-message p.system-message-title { + color: red ; + font-weight: bold } + +div.topic { + margin: 2em } + +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } + +h1.title { + text-align: center } + +h2.subtitle { + text-align: center } + +hr.docutils { + width: 75% } + +img.align-left, .figure.align-left, object.align-left, table.align-left { + clear: left ; + float: left ; + margin-right: 1em } + +img.align-right, .figure.align-right, object.align-right, table.align-right { + clear: right ; + float: right ; + margin-left: 1em } + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left } + +.align-center { + clear: both ; + text-align: center } + +.align-right { + text-align: right } + +/* reset inner alignment in figures */ +div.align-right { + text-align: inherit } + +/* div.align-center * { */ +/* text-align: left } */ + +.align-top { + vertical-align: top } + +.align-middle { + vertical-align: middle } + +.align-bottom { + vertical-align: bottom } + +ol.simple, ul.simple { + margin-bottom: 1em } + +ol.arabic { + list-style: decimal } + +ol.loweralpha { + list-style: lower-alpha } + +ol.upperalpha { + list-style: upper-alpha } + +ol.lowerroman { + list-style: lower-roman } + +ol.upperroman { + list-style: upper-roman } + +p.attribution { + text-align: right ; + margin-left: 50% } + +p.caption { + font-style: italic } + +p.credits { + font-style: italic ; + font-size: smaller } + +p.label { + white-space: nowrap } + +p.rubric { + font-weight: bold ; + font-size: larger ; + color: maroon ; + text-align: center } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + +p.topic-title { + font-weight: bold } + +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font: inherit } + +pre.literal-block, pre.doctest-block, pre.math, pre.code { + margin-left: 2em ; + margin-right: 2em } + +pre.code .ln { color: grey; } /* line numbers */ +pre.code, code { background-color: #eeeeee } +pre.code .comment, code .comment { color: #5C6576 } +pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } +pre.code .literal.string, code .literal.string { color: #0C5404 } +pre.code .name.builtin, code .name.builtin { color: #352B84 } +pre.code .deleted, code .deleted { background-color: #DEB0A1} +pre.code .inserted, code .inserted { background-color: #A3D289} + +span.classifier { + font-family: sans-serif ; + font-style: oblique } + +span.classifier-delimiter { + font-family: sans-serif ; + font-weight: bold } + +span.interpreted { + font-family: sans-serif } + +span.option { + white-space: nowrap } + +span.pre { + white-space: pre } + +span.problematic { + color: red } + +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { + border-left: solid 1px gray; + margin-left: 1px } + +table.docinfo { + margin: 2em 4em } + +table.docutils { + margin-top: 0.5em ; + margin-bottom: 0.5em } + +table.footnote { + border-left: solid 1px black; + margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: top } + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold ; + text-align: left ; + white-space: nowrap ; + padding-left: 0 } + +/* "booktabs" style (no vertical lines) */ +table.docutils.booktabs { + border: 0px; + border-top: 2px solid; + border-bottom: 2px solid; + border-collapse: collapse; +} +table.docutils.booktabs * { + border: 0px; +} +table.docutils.booktabs th { + border-bottom: thin solid; + text-align: left; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { + font-size: 100% } + +ul.auto-toc { + list-style-type: none } + +</style> +</head> +<body> +<div class="document" id="stock-picking-partner-note"> +<h1 class="title">Stock Picking Partner Note</h1> + +<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! This file is generated by oca-gen-addon-readme !! +!! changes will be overwritten. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! source digest: sha256:f95766f575f6b83457b2b0d305d7506a2be1f61adfe5eb9f8581aff1fa377bb9 +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> +<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_partner_note"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_partner_note"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> +<p>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.</p> +<p><strong>Table of contents</strong></p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li> +<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li> +<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul> +<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li> +<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li> +<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="configuration"> +<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1> +<ul class="simple"> +<li>Create partner note types in Inventory > Configuration > Note Types.</li> +<li>In shipping operation types set field Partner Note Type. Only these +types will be shown in picking operations notes.</li> +<li>On contacts add picking notes.</li> +</ul> +<p>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.</p> +</div> +<div class="section" id="bug-tracker"> +<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1> +<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues">GitHub Issues</a>. +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 +<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_partner_note%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<p>Do not contact contributors directly about support or help with technical issues.</p> +</div> +<div class="section" id="credits"> +<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1> +<div class="section" id="authors"> +<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2> +<ul class="simple"> +<li>Camptocamp</li> +<li>BCIM</li> +</ul> +</div> +<div class="section" id="contributors"> +<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2> +<ul class="simple"> +<li>Telmo Santos <<a class="reference external" href="mailto:telmo.santos@camptocamp.com">telmo.santos@camptocamp.com</a>></li> +<li>Jacques-Etienne Baudoux <<a class="reference external" href="mailto:je@bcim.be">je@bcim.be</a>></li> +<li><a class="reference external" href="https://www.360erp.com">360ERP</a>:<ul> +<li>Andrea Stirpe</li> +</ul> +</li> +</ul> +</div> +<div class="section" id="maintainers"> +<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2> +<p>This module is maintained by the OCA.</p> +<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> +<p>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.</p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_partner_note">OCA/stock-logistics-workflow</a> project on GitHub.</p> +<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> +</div> +</div> +</div> +</body> +</html> 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 (<https://www.camptocamp.com>). +# 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("<p>Note 1<br>Note 2</p>", 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 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form </field> + <field name="model">res.config.settings</field> + <field name="inherit_id" ref="stock.res_config_settings_view_form" /> + <field name="arch" type="xml"> + <xpath + expr="//block[@name='operations_setting_container']" + position="inside" + > + <setting + id="check_pickings_partner_note" + string="Check picking note already in use" + help="Add a constraint to check if the picking note is already in use on multiple partner" + > + <field name="check_note_already_in_use" /> + </setting> + </xpath> + </field> + </record> +</odoo> 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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <record id="view_partner_form_inherit" model="ir.ui.view"> + <field name="name">res.partner.form.inherit</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="base.view_partner_form" /> + <field name="arch" type="xml"> + <xpath + expr="//page[@name='internal_notes']//field[@name='comment']" + position="after" + > + <group string="Picking Notes"> + <field + name="stock_picking_note_ids" + widget="one2many_list" + nolabel="1" + colspan="2" + mode="tree" + > + <tree> + <field name="name" /> + <field name="note_type_id" /> + </tree> + </field> + </group> + </xpath> + </field> + </record> +</odoo> 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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <record id="view_stock_picking_note_form" model="ir.ui.view"> + <field name="name">stock.picking.note.form</field> + <field name="model">stock.picking.note</field> + <field name="arch" type="xml"> + <form string="Picking Note"> + <group> + <field name="name" /> + <field name="note_type_id" /> + <field name="active" readonly="1" /> + </group> + </form> + </field> + </record> +</odoo> 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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <record id="view_stock_picking_note_type_tree" model="ir.ui.view"> + <field name="name">stock.picking.note.type.tree</field> + <field name="model">stock.picking.note.type</field> + <field name="arch" type="xml"> + <tree> + <field name="sequence" widget="handle" readonly="1" /> + <field name="name" /> + </tree> + </field> + </record> + + <record id="view_stock_picking_note_type_form" model="ir.ui.view"> + <field name="name">stock.picking.note.type.form</field> + <field name="model">stock.picking.note.type</field> + <field name="arch" type="xml"> + <form string="Picking Note Type"> + <group> + <field name="name" /> + </group> + </form> + </field> + </record> + + <record model="ir.actions.act_window" id="stock_picking_note_types_act_window"> + <field name="name">Stock Picking Note Types</field> + <field name="res_model">stock.picking.note.type</field> + <field name="view_mode">tree,form</field> + <field name="domain">[]</field> + <field name="context">{}</field> + </record> +</odoo> 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 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <menuitem + id="stock_picking_notes_root" + name="Picking Notes" + parent="stock.menu_stock_config_settings" + sequence="10" + groups="stock.group_stock_manager" + /> + <menuitem + id="stock_picking_note_types_menu" + action="stock_picking_note_types_act_window" + name="Note Types" + parent="stock_picking_notes_root" + sequence="10" + /> +</odoo> 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 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="view_picking_type_form" model="ir.ui.view"> + <field name="name">Operation Types</field> + <field name="model">stock.picking.type</field> + <field name="inherit_id" ref="stock.view_picking_type_form" /> + <field name="arch" type="xml"> + <field name="create_backorder" position="after"> + <field name="partner_note_type_ids" widget="many2many_tags" /> + </field> + </field> + </record> +</odoo>