Files
Odoo-18.0-20251222/sale_block_no_stock/models/res_company.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

34 lines
1.0 KiB
Python
Executable File

# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
sale_line_field_block = fields.Many2one(
comodel_name="ir.model.fields",
string="Field to compare quantities on Sale Order Lines",
help="This field will be checked to block the Sale Order Lines "
"if the quantity is not enough",
domain=[
("model_id.model", "=", "sale.order.line"),
(
"name",
"in",
(
"free_qty_today",
"qty_available_today",
"virtual_available_at_date",
),
),
],
)
sale_line_block_allowed_groups = fields.Many2many(
comodel_name="res.groups",
string="Allowed Groups to bypass the block",
help="These groups will be able to bypass the block on the Sale Order Lines "
"if the quantity is not enough",
)