diff --git a/addons/stock/__manifest__.py b/addons/stock/__manifest__.py
index e4570054120..0c443a9aab7 100644
--- a/addons/stock/__manifest__.py
+++ b/addons/stock/__manifest__.py
@@ -26,6 +26,7 @@
'data/stock_data.xml',
'data/stock_sequence_data.xml',
'data/stock_traceability_report_data.xml',
+ 'data/ir_actions_client_data.xml',
'report/report_stock_quantity.xml',
'report/report_stock_reception.xml',
diff --git a/addons/stock/data/ir_actions_client_data.xml b/addons/stock/data/ir_actions_client_data.xml
new file mode 100644
index 00000000000..50bfc67e927
--- /dev/null
+++ b/addons/stock/data/ir_actions_client_data.xml
@@ -0,0 +1,10 @@
+
+
+
+ Add Properties
+ stock.lot
+ action_configure_properties_field
+
+ form
+
+
diff --git a/addons/stock/models/stock_lot.py b/addons/stock/models/stock_lot.py
index 344a004604a..bffad005b81 100644
--- a/addons/stock/models/stock_lot.py
+++ b/addons/stock/models/stock_lot.py
@@ -16,6 +16,10 @@ class StockLot(models.Model):
_check_company_auto = True
_order = 'name, id'
+ def _read_group_location_id(self, locations, domain, order):
+ partner_locations = locations.search([('usage', 'in', ('customer', 'supplier'))])
+ return partner_locations + locations.warehouse_id.search([]).lot_stock_id
+
name = fields.Char(
'Lot/Serial Number', default=lambda self: self.env['ir.sequence'].next_by_code('stock.lot.serial'),
required=True, help="Unique Lot/Serial Number", index='trigram')
@@ -35,7 +39,9 @@ class StockLot(models.Model):
delivery_count = fields.Integer('Delivery order count', compute='_compute_delivery_ids')
last_delivery_partner_id = fields.Many2one('res.partner', compute='_compute_delivery_ids')
lot_properties = fields.Properties('Properties', definition='product_id.lot_properties_definition', copy=True)
- location_id = fields.Many2one('stock.location', 'Location', compute='_compute_single_location', store=True, readonly=False, inverse='_set_single_location', domain="[('usage', '!=', 'view')]")
+ location_id = fields.Many2one(
+ 'stock.location', 'Location', compute='_compute_single_location', store=True, readonly=False,
+ inverse='_set_single_location', domain="[('usage', '!=', 'view')]", group_expand='_read_group_location_id')
@api.model
def generate_lot_names(self, first_lot, count):
diff --git a/addons/stock/views/stock_lot_views.xml b/addons/stock/views/stock_lot_views.xml
index 6389d97c618..65e1358bd59 100644
--- a/addons/stock/views/stock_lot_views.xml
+++ b/addons/stock/views/stock_lot_views.xml
@@ -47,7 +47,7 @@
-
+