[IMP] pre-commit: first run on whole repo
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Default Stock Warehouse on User',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Inventory, Logistics, Warehousing',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Configure a default warehouse on user',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['stock'],
|
||||
'data': [
|
||||
'views/users_view.xml',
|
||||
"name": "Default Stock Warehouse on User",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Inventory, Logistics, Warehousing",
|
||||
"license": "AGPL-3",
|
||||
"summary": "Configure a default warehouse on user",
|
||||
"author": "Akretion",
|
||||
"website": "https://github.com/OCA/odoo-usability",
|
||||
"depends": ["stock"],
|
||||
"data": [
|
||||
"views/users_view.xml",
|
||||
],
|
||||
'installable': False,
|
||||
"installable": False,
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
_inherit = "res.users"
|
||||
|
||||
context_default_warehouse_id = fields.Many2one(
|
||||
'stock.warehouse',
|
||||
string='Default Warehouse',
|
||||
"stock.warehouse",
|
||||
string="Default Warehouse",
|
||||
company_dependent=True,
|
||||
help="Default warehouse for sale orders (if the module "
|
||||
"stock_user_default_warehouse_sale is installed), purchase orders "
|
||||
"(if the module stock_user_default_warehouse_purchase is installed) "
|
||||
"and production orders "
|
||||
"(if the module stock_user_default_warehouse_mrp is installed)."
|
||||
"(if the module stock_user_default_warehouse_mrp is installed).",
|
||||
)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_users_form" model="ir.ui.view">
|
||||
<field name="name">default_stock_warehouse.res.users.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="inherit_id" ref="base.view_users_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="preferences" position="inside">
|
||||
<field name="context_default_warehouse_id"/>
|
||||
<field name="context_default_warehouse_id" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
@@ -16,10 +16,10 @@
|
||||
<record id="view_users_form_simple_modif" model="ir.ui.view">
|
||||
<field name="name">default_stock_warehouse.preferences.res.users.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="preferences" position="inside">
|
||||
<field name="context_default_warehouse_id" readonly="0"/>
|
||||
<field name="context_default_warehouse_id" readonly="0" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class StockChangeProductQty(models.TransientModel):
|
||||
_inherit = 'stock.change.product.qty'
|
||||
_inherit = "stock.change.product.qty"
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
if self.env.user.context_default_warehouse_id:
|
||||
res['location_id'] = self.env.user.context_default_warehouse_id.\
|
||||
lot_stock_id.id
|
||||
res[
|
||||
"location_id"
|
||||
] = self.env.user.context_default_warehouse_id.lot_stock_id.id
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user