mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG]rma_operating_unit to v10
This commit is contained in:
committed by
Aaron ForgeFlow
parent
3eeaa50707
commit
11e53f04fa
22
rma_operating_unit/models/rma_order_line.py
Normal file
22
rma_operating_unit/models/rma_order_line.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- 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, fields, models
|
||||
|
||||
|
||||
class RmaOrderLine(models.Model):
|
||||
|
||||
_inherit = "rma.order.line"
|
||||
|
||||
@api.model
|
||||
def _default_operating_unit(self):
|
||||
if self.rma_id.operating_unit_id:
|
||||
return self.rma_id.operating_unit_id.id
|
||||
return self.env.user.default_operating_unit_id
|
||||
|
||||
operating_unit_id = fields.Many2one(
|
||||
comodel_name='operating.unit',
|
||||
string='Operating Unit',
|
||||
default=_default_operating_unit,
|
||||
)
|
||||
Reference in New Issue
Block a user