mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 07:32:00 +02:00
23 lines
753 B
Python
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']
|