oca-ocb-sale/odoo-bringout-oca-ocb-sale_stock/sale_stock/models/res_users.py
Ernad Husremovic 73afc09215 19.0 vanilla
2026-03-09 09:32:12 +01:00

23 lines
753 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class ResUsers(models.Model):
_inherit = 'res.users'
property_warehouse_id = fields.Many2one('stock.warehouse', string='Default Warehouse', company_dependent=True, check_company=True)
def _get_default_warehouse_id(self):
if self.property_warehouse_id:
return self.property_warehouse_id
return super()._get_default_warehouse_id()
@property
def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + ['property_warehouse_id']
@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + ['property_warehouse_id']