mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "Stock Secondary Unit",
|
||||
"summary": "Get product quantities in a secondary unit",
|
||||
"version": "13.0.1.0.0",
|
||||
"version": "13.0.1.0.1",
|
||||
"development_status": "Production/Stable",
|
||||
"category": "stock",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
|
||||
22
stock_secondary_unit/migrations/13.0.1.0.1/post-migration.py
Normal file
22
stock_secondary_unit/migrations/13.0.1.0.1/post-migration.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openupgradelib import openupgrade # pylint: disable=W7936
|
||||
|
||||
|
||||
@openupgrade.migrate()
|
||||
def migrate(env, version):
|
||||
# Delete old security group for views.
|
||||
views = [
|
||||
"stock_secondary_unit.view_template_property_form",
|
||||
"stock_secondary_unit.product_template_form_view_procurement_button",
|
||||
"stock_secondary_unit.product_form_view_procurement_button",
|
||||
"stock_secondary_unit.product_template_tree_view",
|
||||
"stock_secondary_unit.product_product_tree_view",
|
||||
]
|
||||
IrUiView = env["ir.ui.view"]
|
||||
user_group = env.ref("uom.group_uom")
|
||||
views_to_update = IrUiView.browse()
|
||||
for view in views:
|
||||
views_to_update |= env.ref(view)
|
||||
views_to_update.write({"groups_id": [(3, user_group.id)]})
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="name">Product template Secondary Unit</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form" />
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]" />
|
||||
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='inventory']" position="inside">
|
||||
<group string="Secondary unit">
|
||||
@@ -25,7 +25,7 @@
|
||||
name="inherit_id"
|
||||
ref="stock.product_template_form_view_procurement_button"
|
||||
/>
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]" />
|
||||
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_open_quants']" position="after">
|
||||
<button
|
||||
@@ -54,7 +54,7 @@
|
||||
<record id="product_form_view_procurement_button" model="ir.ui.view">
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="stock.product_form_view_procurement_button" />
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]" />
|
||||
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_open_quants']" position="after">
|
||||
<button
|
||||
@@ -83,7 +83,7 @@
|
||||
<record id="product_template_tree_view" model="ir.ui.view">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_tree_view" />
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]" />
|
||||
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='uom_id']" position="after">
|
||||
<field name="secondary_unit_qty_available" />
|
||||
@@ -97,7 +97,7 @@
|
||||
<record id="product_product_tree_view" model="ir.ui.view">
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_product_tree_view" />
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]" />
|
||||
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='uom_id']" position="after">
|
||||
<field name="secondary_unit_qty_available" />
|
||||
|
||||
Reference in New Issue
Block a user