Compare commits
1 Commits
14.0-imp-s
...
14.0-imp-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
279dc7c6c0 |
@@ -12,20 +12,16 @@ class ProductTemplate(models.Model):
|
|||||||
only one BoM form or a list of BoMs."""
|
only one BoM form or a list of BoMs."""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if self.bom_count == 1:
|
if self.bom_count == 1:
|
||||||
action_xml_id = "mrp.mrp_bom_form_action"
|
action = self.env.ref("mrp.mrp_bom_form_action").read()[0]
|
||||||
action = self.env["ir.actions.actions"]._for_xml_id(action_xml_id)
|
|
||||||
bom = self.env["mrp.bom"].search([("product_tmpl_id", "=", self.id)])
|
bom = self.env["mrp.bom"].search([("product_tmpl_id", "=", self.id)])
|
||||||
action.update(
|
action.update({
|
||||||
{
|
"context": {"default_product_tmpl_id": self.id},
|
||||||
"context": {"default_product_tmpl_id": self.id},
|
"views": False,
|
||||||
"views": False,
|
"view_mode": "form,tree",
|
||||||
"view_mode": "form,tree",
|
"res_id": bom.id,
|
||||||
"res_id": bom.id,
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
action_xml_id = "mrp.template_open_bom"
|
action = self.env.ref("mrp.template_open_bom").read()[0]
|
||||||
action = self.env["ir.actions.actions"]._for_xml_id(action_xml_id)
|
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
@@ -36,11 +32,9 @@ class ProductProduct(models.Model):
|
|||||||
action = super().action_view_bom()
|
action = super().action_view_bom()
|
||||||
bom_target_ids = self.env["mrp.bom"].search(action["domain"])
|
bom_target_ids = self.env["mrp.bom"].search(action["domain"])
|
||||||
if len(bom_target_ids) == 1:
|
if len(bom_target_ids) == 1:
|
||||||
action.update(
|
action.update({
|
||||||
{
|
"views": False,
|
||||||
"views": False,
|
"view_mode": "form,tree",
|
||||||
"view_mode": "form,tree",
|
"res_id": bom_target_ids[0].id,
|
||||||
"res_id": bom_target_ids[0].id,
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
return action
|
return action
|
||||||
|
|||||||
@@ -7,24 +7,24 @@
|
|||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
|
<!--
|
||||||
<record id="account_invoice_form" model="ir.ui.view">
|
<record id="account_invoice_form" model="ir.ui.view">
|
||||||
<field name="name">sale_usability.customer.invoice.form</field>
|
<field name="name">sale_usability.customer.invoice.form</field>
|
||||||
<field name="model">account.move</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="sale.account_invoice_form" />
|
<field name="inherit_id" ref="sale.account_invoice_form"/>
|
||||||
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_manager'))]" />
|
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<div name="button_box" position="inside">
|
<div name="button_box" position="inside">
|
||||||
<button
|
<button name="show_sale_orders"
|
||||||
name="show_sale_orders"
|
type="object"
|
||||||
type="object"
|
class="oe_stat_button"
|
||||||
class="oe_stat_button"
|
icon="fa-pencil-square-o"
|
||||||
icon="fa-pencil-square-o"
|
attrs="{'invisible': [('sale_count', '=', 0)]}">
|
||||||
attrs="{'invisible': [('sale_count', '=', 0)]}">
|
<field name="sale_count" widget="statinfo" string="Sale Orders"/>
|
||||||
<field name="sale_count" widget="statinfo" string="Sale Orders" />
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
-->
|
||||||
|
|
||||||
<record id="view_move_form" model="ir.ui.view">
|
<record id="view_move_form" model="ir.ui.view">
|
||||||
<field name="name">sale_usability.account.move.form</field>
|
<field name="name">sale_usability.account.move.form</field>
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="after">
|
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="after">
|
||||||
<field name="product_barcode" optional="hide"/>
|
<field name="product_barcode" optional="hide"/>
|
||||||
<field name="name" optional="hide"/>
|
<field name="name" optional="hide"/>
|
||||||
<field name="location_id" groups="stock.group_stock_multi_locations" optional="show"/>
|
<field name="location_id" groups="stock.group_stock_multi_locations" optional="show" domain="[('id', 'child_of', 'parent.location_id')]" options="{'no_create': True}"/>
|
||||||
<field name="location_dest_id" groups="stock.group_stock_multi_locations" optional="show"/>
|
<field name="location_dest_id" groups="stock.group_stock_multi_locations" optional="show" domain="[('id', 'child_of', 'parent.location_dest_id')]" options="{'no_create': True}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='move_ids_without_package']/tree/button[@name='action_assign_serial']" position="after">
|
<xpath expr="//field[@name='move_ids_without_package']/tree/button[@name='action_assign_serial']" position="after">
|
||||||
<button type="object" name="button_do_unreserve" string="Unreserve"
|
<button type="object" name="button_do_unreserve" string="Unreserve"
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_picking_internal_search" model="ir.ui.view">
|
<record id="view_picking_internal_search" model="ir.ui.view">
|
||||||
<field name="name">stock_usability.view_picking_search</field>
|
<field name="name">stock_usability.view_picking_search</field>
|
||||||
<field name="model">stock.picking</field>
|
<field name="model">stock.picking</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user