Skip to content

Commit

Permalink
[IMP] rma, rma_account, rma_sale: move override of rma.order views fr…
Browse files Browse the repository at this point in the history
…om wizard views to rma_order_view.xml files
  • Loading branch information
chafique-delli committed Sep 10, 2024
1 parent 58d68a5 commit d11d79f
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 223 deletions.
32 changes: 32 additions & 0 deletions rma/views/rma_order_line_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,38 @@
string="Cancel"
attrs="{'invisible':[('state', 'in', ('done', 'canceled'))]}"
groups="rma.group_rma_customer_user"
/>
<button
name="%(rma.action_rma_picking_in)d"
string="Create Incoming Shipment"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_receive', '=', 0), ('qty_to_receive', '&lt;', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(rma.action_rma_picking_in)d"
string="Create Incoming Shipment"
attrs="{'invisible':['|', '|', ('qty_to_receive', '>', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(rma.action_rma_picking_out)d"
string="Create Delivery"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_deliver', '=', 0), ('qty_to_deliver', '&lt;', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(rma.action_rma_picking_out)d"
string="Create Delivery"
attrs="{'invisible':['|', '|', ('qty_to_deliver', '>', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(rma.action_make_supplier_rma)d"
string="Create Supplier RMA"
attrs="{'invisible':['|', ('type', '!=', 'customer'), ('state', '!=', 'approved')]}"
type="action"
/>
<field
name="state"
Expand Down
46 changes: 46 additions & 0 deletions rma/views/rma_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,38 @@
attrs="{'invisible':[('state', 'in', ('done', 'cancel'))]}"
groups="rma.group_rma_customer_user"
/>
<button
name="%(rma.action_rma_picking_in)d"
string="Create Incoming Shipment"
class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_receive', '=', 0), ('qty_to_receive', '&lt;', 0)]}"
type="action"
/>
<button
name="%(rma.action_rma_picking_out)d"
string="Create Delivery"
class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_deliver', '=', 0), ('qty_to_deliver', '&lt;', 0)]}"
type="action"
/>
<button
name="%(rma.action_rma_add_serial_wiz_customer)d"
string="Add Lot/Serial Numbers"
type="action"
attrs="{'invisible':[('type', '!=', 'customer')]}"
/>
<button
name="%(rma.action_rma_add_stock_move_customer)d"
string="Add From Stock Move"
type="action"
attrs="{'invisible':[('type', '!=', 'customer')]}"
/>
<button
name="%(rma.action_make_supplier_rma)d"
string="Create Supplier RMA"
attrs="{'invisible':['|', ('type', '!=', 'customer'), ('state', '!=', 'approved')]}"
type="action"
/>
<field
name="state"
widget="statusbar"
Expand Down Expand Up @@ -290,6 +322,20 @@
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(rma.action_rma_add_serial_wiz_supplier)d"
string="Add Lot/Serial numbers"
type="action"
attrs="{'invisible':[('type', '!=', 'supplier')]}"
/>
<button
name="%(rma.action_rma_add_stock_move_supplier)d"
string="Add From Stock Move"
type="action"
attrs="{'invisible':[('type', '!=', 'supplier')]}"
/>
</xpath>
<xpath expr="//button[@name='action_view_lines']" position="attributes">
<attribute name="groups">rma.group_rma_supplier_user</attribute>
</xpath>
Expand Down
33 changes: 0 additions & 33 deletions rma/wizards/rma_add_serial_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@
<field name="groups_id" eval="[(4, ref('rma.group_rma_customer_user'))]" />
</record>


<record id="view_rma_add_serial_wiz_customer_form" model="ir.ui.view">
<field name="name">rma.order.form - rma.add.serial.wiz</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_add_serial_wiz_customer)d"
string="Add Lot/Serial Numbers"
type="action"
attrs="{'invisible':[('type', '!=', 'customer')]}"
/>
</xpath>
</field>
</record>

<record id="view_rma_add_serial_wiz_supplier" model="ir.ui.view">
<field name="name">rma.add.serial.wiz.supplier</field>
<field name="model">rma.add.serial.wiz</field>
Expand All @@ -83,20 +66,4 @@
<field name="groups_id" eval="[(4, ref('rma.group_rma_supplier_user'))]" />
</record>

<record id="view_rma_add_serial_wiz_button_supplier_form" model="ir.ui.view">
<field name="name">rma.order.supplier.form - rma.add.serial.wiz</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_supplier_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_add_serial_wiz_supplier)d"
string="Add Lot/Serial numbers"
type="action"
attrs="{'invisible':[('type', '!=', 'supplier')]}"
/>
</xpath>
</field>
</record>

</odoo>
33 changes: 0 additions & 33 deletions rma/wizards/rma_add_stock_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,6 @@
<field name="groups_id" eval="[(4, ref('rma.group_rma_customer_user'))]" />
</record>


<record id="view_rma_add_stock_move_customer_form" model="ir.ui.view">
<field name="name">rma.order.form - stock.move wizard</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_add_stock_move_customer)d"
string="Add From Stock Move"
type="action"
attrs="{'invisible':[('type', '!=', 'customer')]}"
/>
</xpath>
</field>
</record>

<record id="view_rma_add_stock_move_supplier" model="ir.ui.view">
<field name="name">rma.add.stock.move.supplier</field>
<field name="model">rma_add_stock_move</field>
Expand Down Expand Up @@ -172,20 +155,4 @@
<field name="groups_id" eval="[(4, ref('rma.group_rma_supplier_user'))]" />
</record>

<record id="view_rma_add_stock_move_button_supplier_form" model="ir.ui.view">
<field name="name">rma.order.supplier.form - stock.move wizard</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_supplier_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_add_stock_move_supplier)d"
string="Add From Stock Move"
type="action"
attrs="{'invisible':[('type', '!=', 'supplier')]}"
/>
</xpath>
</field>
</record>

</odoo>
60 changes: 0 additions & 60 deletions rma/wizards/rma_make_picking_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,64 +98,4 @@
<field name="binding_model_id" ref="rma.model_rma_order_line" />
</record>

<record id="view_rma_line_button_form" model="ir.ui.view">
<field name="name">rma.order.line.form</field>
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="arch" type="xml">
<header position="inside">
<button
name="%(action_rma_picking_in)d"
string="Create Incoming Shipment"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_receive', '=', 0), ('qty_to_receive', '&lt;', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(action_rma_picking_in)d"
string="Create Incoming Shipment"
attrs="{'invisible':['|', '|', ('qty_to_receive', '>', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(action_rma_picking_out)d"
string="Create Delivery"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_deliver', '=', 0), ('qty_to_deliver', '&lt;', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(action_rma_picking_out)d"
string="Create Delivery"
attrs="{'invisible':['|', '|', ('qty_to_deliver', '>', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action"
/>
</header>
</field>
</record>

<record id="view_rma_button_form" model="ir.ui.view">
<field name="name">rma.order.form</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<header position="inside">
<button
name="%(action_rma_picking_in)d"
string="Create Incoming Shipment"
class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_receive', '=', 0), ('qty_to_receive', '&lt;', 0)]}"
type="action"
/>
<button
name="%(action_rma_picking_out)d"
string="Create Delivery"
class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_deliver', '=', 0), ('qty_to_deliver', '&lt;', 0)]}"
type="action"
/>
</header>
</field>
</record>

</odoo>
31 changes: 0 additions & 31 deletions rma/wizards/rma_make_supplier_rma_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,4 @@
<field name="binding_model_id" ref="rma.model_rma_order_line" />
</record>

<record id="view_rma_line_supplier_rma_button_form" model="ir.ui.view">
<field name="name">rma.order.line.supplier.rma.form</field>
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="arch" type="xml">
<header position="inside">
<button
name="%(action_make_supplier_rma)d"
string="Create Supplier RMA"
attrs="{'invisible':['|', ('type', '!=', 'customer'), ('state', '!=', 'approved')]}"
type="action"
/>
</header>
</field>
</record>

<record id="view_rma_supplier_rma_button_form" model="ir.ui.view">
<field name="name">rma.supplier.rma.form</field>
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<header position="inside">
<button
name="%(action_make_supplier_rma)d"
string="Create Supplier RMA"
attrs="{'invisible':['|', ('type', '!=', 'customer'), ('state', '!=', 'approved')]}"
type="action"
/>
</header>
</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions rma_account/views/rma_order_line_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(rma_account.action_rma_refund)d"
string="Create Refund"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_refund', '=', 0), ('qty_to_refund', '&lt;', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(rma_account.action_rma_refund)d"
string="Create Refund"
attrs="{'invisible':['|', '|', ('qty_to_refund', '>', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
</xpath>
<button name="action_view_out_shipments" position="after">
<button
type="object"
Expand Down
15 changes: 15 additions & 0 deletions rma_account/views/rma_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(rma_account.action_rma_refund)d"
string="Create Refund"
class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_refund', '=', 0), ('qty_to_refund', '&lt;', 0), ('state', '!=', 'approved')]}"
type="action"
/>
<button
name="%(rma_account.action_rma_refund)d"
string="Create Refund"
attrs="{'invisible':['|', ('qty_to_refund', '>', 0), ('state', '!=', 'approved')]}"
type="action"
/>
</xpath>
<button name="action_view_out_shipments" position="after">
<button
type="object"
Expand Down
45 changes: 0 additions & 45 deletions rma_account/wizards/rma_refund.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,49 +49,4 @@
<field name="target">new</field>
</record>

<record id="view_rma_line_button_refund_form" model="ir.ui.view">
<field name="name">rma.order.line.form</field>
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_refund)d"
string="Create Refund"
class="oe_highlight"
attrs="{'invisible':['|', '|', '|', ('qty_to_refund', '=', 0), ('qty_to_refund', '&lt;', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(action_rma_refund)d"
string="Create Refund"
attrs="{'invisible':['|', '|', ('qty_to_refund', '>', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
</xpath>
</field>
</record>

<record id="view_rma_button_refund_form" model="ir.ui.view">
<field name="model">rma.order</field>
<field name="inherit_id" ref="rma.view_rma_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button
name="%(action_rma_refund)d"
string="Create Refund"
class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_refund', '=', 0), ('qty_to_refund', '&lt;', 0), ('state', '!=', 'approved')]}"
type="action"
/>
<button
name="%(action_rma_refund)d"
string="Create Refund"
attrs="{'invisible':['|', ('qty_to_refund', '>', 0), ('state', '!=', 'approved')]}"
type="action"
/>
</xpath>
</field>
</record>

</odoo>
Loading

0 comments on commit d11d79f

Please sign in to comment.