Add wizard button and view
This commit is contained in:
parent
bc3862bd50
commit
b021c89d67
2 changed files with 20 additions and 0 deletions
|
|
@ -6,6 +6,14 @@ from odoo import _, fields, models
|
|||
class SaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
def action_min_max_qty_wizard(self):
|
||||
return {
|
||||
"name": _("Min max qty wizard"),
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "sale.order.line",
|
||||
"view_mode": "tree,form",
|
||||
"domain": [("id", "in", self.order_line.ids)],
|
||||
}
|
||||
|
||||
def _prepare_order_line_values(
|
||||
self, product_id, quantity, linked_line_id=False,
|
||||
|
|
|
|||
|
|
@ -11,4 +11,16 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_order_list_inherit_product_min_max_qty" model="ir.ui.view">
|
||||
<field name="name">sale.order.list.view.inherited</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_quotation_tree_with_onboarding"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="inside">
|
||||
<header>
|
||||
<button type="object" name="action_min_max_qty_wizard" string="Min/Max Wizard" class="btn btn-primary"/>
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Reference in a new issue