mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 23:52:04 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class Users(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
|
||||
# !!! Any change to the following search domain should probably
|
||||
# be also applied in sale_stock/models/sale_order.py/_init_column.
|
||||
return self.env['stock.warehouse'].search([('company_id', '=', self.env.company.id)], limit=1)
|
||||
|
||||
@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']
|
||||
Loading…
Add table
Add a link
Reference in a new issue