Skip to content

Commit

Permalink
Merge PR #1504 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by simahawk
  • Loading branch information
OCA-git-bot committed Mar 15, 2024
2 parents fe13171 + 1014270 commit 69032fd
Show file tree
Hide file tree
Showing 26 changed files with 1,005 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_partner_note/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
88 changes: 88 additions & 0 deletions stock_picking_partner_note/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
==========================
Stock Picking Partner Note
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:118a441384332266ee32bde5dd56e5c2490ecc86fa0cb5a64eb6f7472e3b62a7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/14.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-14-0/stock-logistics-workflow-14-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=14.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.

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:%2014.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>

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/14.0/stock_picking_partner_note>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions stock_picking_partner_note/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
24 changes: 24 additions & 0 deletions stock_picking_partner_note/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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": "14.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",
],
"installable": True,
"auto_install": False,
}
54 changes: 54 additions & 0 deletions stock_picking_partner_note/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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"
"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__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_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_type__partner_note_type_ids
msgid "Partner Note Type"
msgstr "Type de note partenaire"

#. module: stock_picking_partner_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_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_terms:ir.ui.view,arch_db:stock_picking_partner_note.view_stock_picking_note_type_tree
msgid "Picking Note Types"
msgstr "Opération Types de note"
140 changes: 140 additions & 0 deletions stock_picking_partner_note/i18n/stock_picking_partner_note.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# 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: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,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 ""
5 changes: 5 additions & 0 deletions stock_picking_partner_note/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import stock_picking_note_type
from . import stock_picking_note
from . import stock_picking_type
from . import stock_picking
from . import res_partner
14 changes: 14 additions & 0 deletions stock_picking_partner_note/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -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",
)
30 changes: 30 additions & 0 deletions stock_picking_partner_note/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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


class StockPicking(models.Model):
_inherit = "stock.picking"

note = fields.Html(compute="_compute_note", store=True)

# TODO: ideally, we should add more detailed dependencies here;
# however, there's a CacheMiss error that occurs when adding
# "picking_type_id.partner_note_type_ids" and "partner_id.stock_picking_note_ids"
# so we're leaving it like this for now
# (the partner should be enough to trigger the compute).
@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: n.active and n.note_type_id in picking_type_note_type_ids
)
picking_notes = [
note.name.strip()
for note in picking_notes
if note.name and note.name.strip()
]
picking.note = "<br />".join(picking_notes)
16 changes: 16 additions & 0 deletions stock_picking_partner_note/models/stock_picking_note.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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 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)
Loading

0 comments on commit 69032fd

Please sign in to comment.