diff --git a/stock_inventory_verification_request/__manifest__.py b/stock_inventory_verification_request/__manifest__.py
index 1f173bcee..ba0d78ae9 100644
--- a/stock_inventory_verification_request/__manifest__.py
+++ b/stock_inventory_verification_request/__manifest__.py
@@ -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',
diff --git a/stock_inventory_verification_request/models/stock_inventory.py b/stock_inventory_verification_request/models/stock_inventory.py
index 10d73a584..339dc663a 100644
--- a/stock_inventory_verification_request/models/stock_inventory.py
+++ b/stock_inventory_verification_request/models/stock_inventory.py
@@ -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,
})
diff --git a/stock_inventory_verification_request/models/stock_slot_verification_request.py b/stock_inventory_verification_request/models/stock_slot_verification_request.py
index e91cf1e1f..90e426fce 100644
--- a/stock_inventory_verification_request/models/stock_slot_verification_request.py
+++ b/stock_inventory_verification_request/models/stock_slot_verification_request.py
@@ -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]
diff --git a/stock_inventory_verification_request/security/stock_security.xml b/stock_inventory_verification_request/security/stock_security.xml
new file mode 100644
index 000000000..9c8f169fe
--- /dev/null
+++ b/stock_inventory_verification_request/security/stock_security.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Stock Slot Verification Request multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+
diff --git a/stock_inventory_verification_request/views/stock_slot_verification_request_view.xml b/stock_inventory_verification_request/views/stock_slot_verification_request_view.xml
index e9a1bc649..af94e2225 100644
--- a/stock_inventory_verification_request/views/stock_slot_verification_request_view.xml
+++ b/stock_inventory_verification_request/views/stock_slot_verification_request_view.xml
@@ -17,6 +17,7 @@
+
@@ -83,6 +84,7 @@
+
@@ -110,6 +112,7 @@
+