Files
stock-rma/rma_analytic/models/procurement.py
2023-07-19 06:54:43 +00:00

20 lines
609 B
Python

# -*- coding: utf-8 -*-
# © 2018 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import _, api, exceptions, models
class ProcurementOrder(models.Model):
_inherit = "procurement.order"
@api.constrains('analytic_account_id')
def check_analytic(self):
for order in self:
if order.analytic_account_id != order.rma_line_id.analytic_account_id:
raise exceptions.ValidationError(
_("The analytic account in the procurement it's not the same"
" as in the rma line"))