[IMP] stock: rework properties button and kanban view

The properties button has been moved to the contextual action menu.
The kanban view now shows partner locations and internal location directly under a view location

task 3444583

closes odoo/odoo#130509

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
This commit is contained in:
snd
2023-09-14 12:42:30 +00:00
parent 707cb82117
commit a387e9591e
4 changed files with 19 additions and 2 deletions
+1
View File
@@ -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',
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<odoo>
<record id="stock_lot_action_configure_properties_field" model="ir.actions.client">
<field name="name">Add Properties</field>
<field name="res_model">stock.lot</field>
<field name="tag">action_configure_properties_field</field>
<field name="binding_model_id" ref="stock.model_stock_lot"/>
<field name="binding_view_types">form</field>
</record>
</odoo>
+7 -1
View File
@@ -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):
+1 -1
View File
@@ -47,7 +47,7 @@
<field name="last_delivery_partner_id" invisible="not last_delivery_partner_id" groups="stock.group_stock_manager"/>
</group>
<group></group>
<field name="lot_properties" nolabel="1" columns="2"/>
<field name="lot_properties" nolabel="1" columns="2" hideAddButton="1"/>
</group>
<notebook invisible="not display_complete">
<page string="Description" name="description">