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 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import res_partner
from . import sale_order

View File

@@ -0,0 +1,23 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
customer_need_po = fields.Boolean(
string="Customer Requires PO",
tracking=True,
help="A PO number will be required on the"
" Sales Order field for Customer Reference",
)
sale_doc = fields.Text(
string="Sales Require Documentation",
tracking=True,
help="Details of the sales documentation required for this customer."
" Sales documentation notes field will be required on Sales Orders"
" This is complementary to requiring a PO number, and can be used"
" with or without that setting.",
)

View File

@@ -0,0 +1,42 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo.exceptions import ValidationError
class SaleOrder(models.Model):
_inherit = "sale.order"
customer_need_po = fields.Boolean(
related="partner_id.customer_need_po",
string="Customer Requires PO",
)
sale_doc = fields.Text(
related="partner_id.sale_doc",
string="Sales Require Documentation",
)
sale_document_option = fields.Selection(
[
("no_need", "No documentation needed for this Sale"),
("done", "Documentation required obtained and archived"),
],
string="Sale Documentation",
)
sale_document_note = fields.Text(string="Sale Documentation Notes")
def action_confirm(self):
for order in self:
if order.customer_need_po and not order.client_order_ref:
raise ValidationError(
self.env._(
"You can not confirm sale order without Customer reference."
)
)
if order.sale_doc and not order.sale_document_option:
raise ValidationError(
self.env._(
"You can not confirm sale order without Sale Documentation."
)
)
return super().action_confirm()