Initial commit: Odoo 18.0-20251222 extra-addons
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

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import sale_order
from . import sale_order_line
from . import stock_move

View File

@@ -0,0 +1,36 @@
# Copyright 2018 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.addons.stock.models import stock_move
class SaleOrder(models.Model):
_inherit = "sale.order"
priority = fields.Selection(
stock_move.PROCUREMENT_PRIORITIES,
compute="_compute_priority",
inverse="_inverse_priority",
store=True,
index=True,
tracking=True,
help="Priority for this sale order. "
"Setting manually a value here would set it as priority "
"for all the order lines",
)
@api.depends("order_line.priority")
def _compute_priority(self):
for order in self.filtered(lambda x: x.order_line):
priority = order.mapped("order_line.priority")
order.priority = max([x for x in priority if x] or "0")
def _inverse_priority(self):
for order in self:
priority = order.priority
for line in order.order_line.filtered(
lambda x, pr=priority: x.priority != pr
):
line.priority = priority

View File

@@ -0,0 +1,12 @@
# Copyright 2018 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo.addons.stock.models import stock_move
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
priority = fields.Selection(stock_move.PROCUREMENT_PRIORITIES, default="0")

View File

@@ -0,0 +1,11 @@
from odoo import models
class StockMove(models.Model):
_inherit = "stock.move"
def _get_new_picking_values(self):
picking_values = super()._get_new_picking_values()
if self.group_id.sale_id.priority:
picking_values["priority"] = self.group_id.sale_id.priority
return picking_values