Files
Odoo-18.0-20251222/sale_stock_picking_note/models/stock_picking.py
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

42 lines
1.2 KiB
Python
Executable File

# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class StockPicking(models.Model):
_inherit = "stock.picking"
customer_note = fields.Text(
string="Customer Comments",
compute="_compute_picking_notes",
store=True,
readonly=False,
)
note = fields.Html(
compute="_compute_picking_notes",
store=True,
readonly=False,
)
@api.depends(
"sale_id",
"sale_id.picking_note",
"sale_id.picking_customer_note",
"partner_id",
"picking_type_id",
)
def _compute_picking_notes(self):
for picking in self:
if picking.picking_type_id.code != "incoming" and picking.state not in (
"done",
"cancel",
):
picking.note = (
picking.sale_id.picking_note or picking.partner_id.picking_note
)
picking.customer_note = (
picking.sale_id.picking_customer_note
or picking.partner_id.picking_customer_note
)