[IMP] rma: Do not highlight all action buttons and simplify

rma.line views, supplier view is an extension of customer one.

This makes easier to edit common elements in both views and ease
maintenance.
This commit is contained in:
Lois Rilo
2021-03-26 11:27:15 +01:00
committed by JasminSForgeFlow
parent 1fcc4bef42
commit 67a603e555
3 changed files with 101 additions and 302 deletions

View File

@@ -48,242 +48,6 @@
</field> </field>
</record> </record>
<record id="view_rma_line_supplier_form" model="ir.ui.view">
<field name="name">rma.order.line.supplier.form</field>
<field name="model">rma.order.line</field>
<field name="arch" type="xml">
<form string="RMA Line">
<header>
<button
name="action_rma_to_approve"
type="object"
string="Request Approval"
attrs="{'invisible':[('state', '!=', 'draft')]}"
class="oe_highlight"
groups="rma.group_rma_customer_user"
/>
<button
name="action_rma_draft"
type="object"
string="Back to Draft"
attrs="{'invisible':[('state', '=', 'draft')]}"
class="oe_highlight"
groups="rma.group_rma_customer_user,rma.group_rma_supplier_user"
/>
<button
name="action_rma_approve"
type="object"
string="Approve"
attrs="{'invisible':[('state', '!=', 'to_approve')]}"
class="oe_highlight"
groups="rma.group_rma_customer_user"
/>
<button
name="action_rma_done"
type="object"
string="Done"
attrs="{'invisible':[('state', 'in', ('done', 'draft'))]}"
groups="rma.group_rma_customer_user"
/>
<field name="state" widget="statusbar" nolabel="1" />
</header>
<sheet>
<div name="button_box" class="oe_button_box">
<button
type="object"
name="action_view_in_shipments"
class="oe_stat_button"
icon="fa-truck"
groups="stock.group_stock_user"
>
<field
name="in_shipment_count"
widget="statinfo"
string="Shipments"
/>
</button>
<button
type="object"
name="action_view_out_shipments"
class="oe_stat_button"
icon="fa-truck"
groups="stock.group_stock_user"
>
<field
name="out_shipment_count"
widget="statinfo"
string="Deliveries"
/>
</button>
<button
type="object"
name="action_view_rma_lines"
class="oe_stat_button"
icon="fa-link"
groups="stock.group_stock_user"
>
<field
name="rma_line_count"
widget="statinfo"
string="Customer RMA"
/>
</button>
</div>
<div class="oe_title" name="title">
<h1>
<field
name="name"
readonly="1"
invisible="context.get('hide_title',False)"
/>
</h1>
</div>
<group>
<group name="partner">
<field
name="partner_id"
context="{'res_partner_search_mode': 'supplier'}"
string="Supplier"
/>
<field
name="delivery_address_id"
domain="['|', ('parent_id', '=', partner_id),('id', '=', partner_id)]"
context="{'show_address': 1}"
options="{'always_reload': 1}"
groups='rma.group_rma_delivery_invoice_address'
/>
</group>
</group>
<group>
<group name="product" string="Product">
<field name="product_id" />
<newline />
<field name="product_tracking" invisible="1" />
<field
name="lot_id"
groups="stock.group_production_lot"
attrs="{'required': [('product_tracking', 'in', ('serial', 'lot'))]}"
domain="[('product_id', '=', product_id)]"
/>
</group>
<group name="product_qty" string="Quantity">
<field name="product_qty" />
<field name="price_unit" />
<field name="uom_id" groups="uom.group_uom" />
</group>
</group>
<group name="main_info" string="Origin">
<field
name="reference_move_id"
options="{'no_create': True}"
domain="[('picking_id.partner_id', '=', partner_id),
('location_id.usage', '=', 'supplier'),
('state', '=', 'done')]"
/>
</group>
<group>
<group name="operation" string="Operation">
<field
name="operation_id"
domain="[('type','=','supplier')]"
/>
<field name="receipt_policy" />
<field name="delivery_policy" />
</group>
<group name="description" string="Description">
<field name="description" nolabel="1" />
</group>
<group name="contact" string="Contact">
<field name="requested_by" readonly="1" />
<field name="assigned_to" />
</group>
</group>
<notebook>
<page name="route" string="Routes">
<group>
<group name="inbound" string="Inbound">
<field name="in_warehouse_id" />
<field
name="location_id"
domain="[('usage', '=', 'internal')]"
/>
<field
name="in_route_id"
groups="stock.group_adv_location"
/>
</group>
<group name="outbound" string="Outbound">
<field name="out_warehouse_id" />
<field
name="out_route_id"
groups="stock.group_adv_location"
/>
<field name="supplier_to_customer" />
<field
name="customer_address_id"
context="{'show_address': 1}"
options="{'always_reload': 1}"
attrs="{'required':[('supplier_to_customer', '=', True)],
'invisible':[('supplier_to_customer', '=', False)]}"
/>
</group>
</group>
</page>
<page name="stock" string="Stock Moves">
<field name="move_ids" nolabel="1" readonly="1" />
</page>
<page name="quantities" string="Quantities">
<group>
<group
name="quantities"
col="4"
string="Quantities"
>
<group name="receive">
<field name="qty_to_receive" />
<field name="qty_incoming" />
<field name="qty_received" />
</group>
<group name="deliver">
<field name="qty_to_deliver" />
<field name="qty_outgoing" />
<field name="qty_delivered" />
</group>
</group>
</group>
</page>
<page name="other" string="Other Info">
<group name="general" string="General">
<field name="conditions" />
<field
name="rma_id"
groups="rma.group_rma_groups"
/>
<field name="origin" />
</group>
<group
name="company"
string="Company"
groups="base.group_multi_company"
>
<field name="company_id" />
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field
name="message_follower_ids"
widget="mail_followers"
groups="base.group_user"
/>
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record id="view_rma_line_form" model="ir.ui.view"> <record id="view_rma_line_form" model="ir.ui.view">
<field name="name">rma.order.line.form</field> <field name="name">rma.order.line.form</field>
<field name="model">rma.order.line</field> <field name="model">rma.order.line</field>
@@ -303,7 +67,6 @@
type="object" type="object"
string="Back to Draft" string="Back to Draft"
attrs="{'invisible':[('state', '=', 'draft')]}" attrs="{'invisible':[('state', '=', 'draft')]}"
class="oe_highlight"
groups="rma.group_rma_customer_user,rma.group_rma_supplier_user" groups="rma.group_rma_customer_user,rma.group_rma_supplier_user"
/> />
<button <button
@@ -380,7 +143,7 @@
/> />
</h1> </h1>
</div> </div>
<group name="partner"> <group>
<group name="partner"> <group name="partner">
<field <field
name="partner_id" name="partner_id"
@@ -395,7 +158,13 @@
options="{'always_reload': 1}" options="{'always_reload': 1}"
groups='rma.group_rma_delivery_invoice_address' groups='rma.group_rma_delivery_invoice_address'
/> />
<field name="under_warranty" /> </group>
<group>
<group name="contact">
<field name="requested_by" readonly="1" />
<field name="assigned_to" />
<field name="type" invisible="1" />
</group>
</group> </group>
</group> </group>
<group> <group>
@@ -408,6 +177,7 @@
groups="stock.group_production_lot" groups="stock.group_production_lot"
attrs="{'required': [('product_tracking', 'in', ('serial', 'lot'))]}" attrs="{'required': [('product_tracking', 'in', ('serial', 'lot'))]}"
/> />
<field name="under_warranty" />
</group> </group>
<group name="product_qty" string="Quantity"> <group name="product_qty" string="Quantity">
<field name="product_qty" /> <field name="product_qty" />
@@ -437,44 +207,7 @@
<field name="description" nolabel="1" /> <field name="description" nolabel="1" />
</group> </group>
</group> </group>
<group>
<group name="contact" string="Contact">
<field name="requested_by" readonly="1" />
<field name="assigned_to" />
</group>
</group>
<notebook> <notebook>
<page name="route" string="Routes">
<group name="inbound" string="Inbound">
<field name="in_warehouse_id" />
<field
name="location_id"
domain="[('usage', '=', 'internal')]"
/>
<field
name="in_route_id"
groups="stock.group_adv_location"
/>
<field name="customer_to_supplier" />
<field
name="supplier_address_id"
context="{'show_address': 1}"
options="{'always_reload': 1}"
attrs="{'required':[('customer_to_supplier', '=', True)],
'invisible':[('customer_to_supplier', '=', False)]}"
/>
</group>
<group name="outbound" string="Outbound">
<field name="out_warehouse_id" />
<field
name="out_route_id"
groups="stock.group_adv_location"
/>
</group>
</page>
<page name="stock" string="Stock Moves">
<field name="move_ids" nolabel="1" readonly="1" />
</page>
<page name="quantities" string="Quantities"> <page name="quantities" string="Quantities">
<group name="quantities" col="4" string="Quantities"> <group name="quantities" col="4" string="Quantities">
<group name="receive"> <group name="receive">
@@ -489,13 +222,58 @@
</group> </group>
<group <group
name="supplier_rma" name="supplier_rma"
attrs="{'invisible':[('customer_to_supplier','=',False)]}" attrs="{'invisible':['|', ('type', '!=', 'customer'), ('customer_to_supplier','=',False)]}"
> >
<field name="qty_to_supplier_rma" /> <field name="qty_to_supplier_rma" />
<field name="qty_in_supplier_rma" /> <field name="qty_in_supplier_rma" />
</group> </group>
</group> </group>
</page> </page>
<page name="route" string="Routes">
<group name="inbound" string="Inbound">
<field name="in_warehouse_id" />
<field
name="location_id"
domain="[('usage', '=', 'internal')]"
/>
<field
name="in_route_id"
groups="stock.group_adv_location"
/>
<field
name="customer_to_supplier"
attrs="{'invisible':[('type', '!=', 'customer')]}"
/>
<field
name="supplier_address_id"
context="{'show_address': 1}"
options="{'always_reload': 1}"
attrs="{'required':[('customer_to_supplier', '=', True)],
'invisible':[('customer_to_supplier', '=', False)]}"
/>
</group>
<group name="outbound" string="Outbound">
<field name="out_warehouse_id" />
<field
name="out_route_id"
groups="stock.group_adv_location"
/>
<field
name="supplier_to_customer"
attrs="{'invisible':[('type', '!=', 'supplier')]}"
/>
<field
name="customer_address_id"
context="{'show_address': 1}"
options="{'always_reload': 1}"
attrs="{'required':[('supplier_to_customer', '=', True)],
'invisible':[('supplier_to_customer', '=', False)]}"
/>
</group>
</page>
<page name="stock" string="Stock Moves">
<field name="move_ids" nolabel="1" readonly="1" />
</page>
<page name="other" string="Other Info"> <page name="other" string="Other Info">
<group name="general" string="General"> <group name="general" string="General">
<field name="conditions" /> <field name="conditions" />
@@ -527,6 +305,40 @@
</field> </field>
</record> </record>
<record id="view_rma_line_supplier_form" model="ir.ui.view">
<field name="name">rma.order.line.supplier.form</field>
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_form" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath
expr="//button[@name='action_view_rma_lines']/field"
position="attributes"
>
<attribute name="string">Customer RMA</attribute>
</xpath>
<field name="partner_id" position="attributes">
<attribute name="string">Supplier</attribute>
<attribute
name="context"
>{'res_partner_search_mode': 'supplier'}</attribute>
</field>
<field name="under_warranty" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="reference_move_id" position="attributes">
<attribute
name="domain"
>[('picking_id.partner_id', '=', partner_id),
('location_id.usage', '=', 'supplier'),
('state', '=', 'done')]</attribute>
</field>
<field name="operation_id" position="attributes">
<attribute name="domain">[('type','=','supplier')]</attribute>
</field>
</field>
</record>
<record id="view_rma_rma_line_filter" model="ir.ui.view"> <record id="view_rma_rma_line_filter" model="ir.ui.view">
<field name="name">rma.order.line.select</field> <field name="name">rma.order.line.select</field>
<field name="model">rma.order.line</field> <field name="model">rma.order.line</field>

View File

@@ -106,40 +106,28 @@
<header position="inside"> <header position="inside">
<button <button
name="%(action_rma_picking_in)d" name="%(action_rma_picking_in)d"
states="approved"
string="Create Incoming Shipment" string="Create Incoming Shipment"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_receive', '=', 0), ('state', '!=', 'approved')]}"
type="action" type="action"
/> />
<button
name="%(action_rma_picking_out)d"
states="approved"
string="Create Delivery"
class="oe_highlight"
type="action"
/>
</header>
</field>
</record>
<record id="view_rma_line_supplier_button_form" model="ir.ui.view">
<field name="name">rma.order.line.supplier.form</field>
<field name="model">rma.order.line</field>
<field name="inherit_id" ref="rma.view_rma_line_supplier_form" />
<field name="arch" type="xml">
<header position="inside">
<button <button
name="%(action_rma_picking_in)d" name="%(action_rma_picking_in)d"
states="approved"
string="Create Incoming Shipment" string="Create Incoming Shipment"
class="oe_highlight" attrs="{'invisible':['|', ('qty_to_receive', '!=', 0), ('state', '!=', 'approved')]}"
type="action" type="action"
/> />
<button <button
name="%(action_rma_picking_out)d" name="%(action_rma_picking_out)d"
states="approved"
string="Create Delivery" string="Create Delivery"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_deliver', '=', 0), ('state', '!=', 'approved')]}"
type="action"
/>
<button
name="%(action_rma_picking_out)d"
string="Create Delivery"
attrs="{'invisible':['|', ('qty_to_deliver', '!=', 0), ('state', '!=', 'approved')]}"
type="action" type="action"
/> />
</header> </header>

View File

@@ -67,9 +67,8 @@
<header position="inside"> <header position="inside">
<button <button
name="%(action_rma_order_line_make_supplier_rma)d" name="%(action_rma_order_line_make_supplier_rma)d"
states="approved"
string="Create Supplier RMA" string="Create Supplier RMA"
class="oe_highlight" attrs="{'invisible':['|', ('type', '!=', 'customer'), ('state', '!=', 'approved')]}"
type="action" type="action"
/> />
</header> </header>