mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
20 lines
609 B
Python
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"))
|