mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[12.0][IMP] stock_inventory_verification_request: support multi-company setup
This commit is contained in:
committed by
Joan Sisquella
parent
d7b9a7053b
commit
6beea72e8b
@@ -5,7 +5,7 @@
|
||||
"name": "Stock Inventory Verification Request",
|
||||
"summary": "Adds the capability to request a Slot Verification when "
|
||||
"a inventory is Pending to Approve",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "12.0.2.0.0",
|
||||
"development_status": "Mature",
|
||||
"maintainers": ['LoisRForgeFlow'],
|
||||
"author": "ForgeFlow, "
|
||||
@@ -18,6 +18,7 @@
|
||||
],
|
||||
"data": [
|
||||
'security/ir.model.access.csv',
|
||||
'security/stock_security.xml',
|
||||
'views/stock_slot_verification_request_view.xml',
|
||||
'views/stock_inventory_view.xml',
|
||||
'views/stock_location_view.xml',
|
||||
|
||||
@@ -31,6 +31,7 @@ class StockInventory(models.Model):
|
||||
'location_id': line.location_id.id,
|
||||
'state': 'wait',
|
||||
'product_id': line.product_id.id,
|
||||
'company_id': self.company_id.id,
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ class SlotVerificationRequest(models.Model):
|
||||
_inherit = 'mail.thread'
|
||||
_description = "Slot Verification Request"
|
||||
|
||||
@api.model
|
||||
def _default_company(self):
|
||||
company_id = self.env['res.company']._company_default_get(self._name)
|
||||
return company_id
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if not vals.get('name') or vals.get('name') == '/':
|
||||
@@ -50,6 +55,12 @@ class SlotVerificationRequest(models.Model):
|
||||
readonly=True, states={'wait': [('readonly', False)]},
|
||||
track_visibility="onchange",
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company', string='Company',
|
||||
required=True,
|
||||
default=_default_company,
|
||||
readonly=True,
|
||||
)
|
||||
state = fields.Selection(selection=[
|
||||
('wait', 'Waiting Actions'),
|
||||
('open', 'In Progress'),
|
||||
@@ -177,6 +188,7 @@ class SlotVerificationRequest(models.Model):
|
||||
"location_id": self.location_id.id,
|
||||
"product_id": self.product_id.id,
|
||||
"solving_slot_verification_request_id": self.id,
|
||||
"company_id": self.company_id.id,
|
||||
})
|
||||
action = self.env.ref('stock.action_inventory_form')
|
||||
result = action.read()[0]
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="stock_slot_verification_request_comp_rule" model="ir.rule">
|
||||
<field name="name">Stock Slot Verification Request multi-company</field>
|
||||
<field name="model_id" ref="model_stock_slot_verification_request"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -17,6 +17,7 @@
|
||||
<field name="responsible_id"/>
|
||||
<field name="inventory_id"/>
|
||||
<field name="state"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -83,6 +84,7 @@
|
||||
<group>
|
||||
<field name="location_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="create_uid" readonly="1"/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
<field name="responsible_id"/>
|
||||
@@ -110,6 +112,7 @@
|
||||
<field name="name"/>
|
||||
<field name="location_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="responsible_id"/>
|
||||
<separator/>
|
||||
<filter name="wait_state" string="Waiting Actions"
|
||||
|
||||
Reference in New Issue
Block a user