[REF] crm_claim_rma : refactor view and add description into the refund wizard

This commit is contained in:
sebastien beau
2012-09-12 19:00:33 +02:00
parent 62875266b5
commit 3474739519
2 changed files with 29 additions and 45 deletions

View File

@@ -217,52 +217,25 @@
<field name="invoice_ids" colspan="4" nolabel="1" readonly="1"/>
<field name="picking_ids" colspan="4" nolabel="1" readonly="1"/>
</xpath>
<page string="Communication &amp; History" position="after">
<page string="Product return">
<field name="invoice_id" colspan="1" on_change="onchange_invoice_id(invoice_id, context)" domain="[('partner_id','=',partner_id)]" />
<field name="claim_line_ids" nolabel="1" colspan="4"/>
<group col="1" rowspan="3">
<separator string="Add lines" colspan="4"/>
<button name="%(action_create_return_serial)d" string="Mass return from serial/lot n°" states="draft,open" type="action" target="new"/>
<!-- <button name="(action_create_return_inv)d" string="Mass return from invoice" states="draft,open" type="action" target="new"/> -->
</group>
<!-- <group col="1" rowspan="3"> -->
<!-- <separator string="Line selection" colspan="4"/> -->
<!-- <button name="select_all" string="Select all" states="draft,open" type="object"/> -->
<!-- <button name="unselect_all" string="Select none" states="draft,open" type="object"/> -->
<!-- </group> -->
<group col="2" rowspan="3">
<separator string="From selected lines" colspan="4"/>
<button name="%(action_claim_picking_in)d" string="New picking IN" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
<button name="%(action_claim_picking_out)d" string="New picking OUT" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id, 'customer_id': partner_id}"/>
<button name="%(action_claim_picking_loss)d" string="New Product Loss" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
<button name="%(account.action_account_invoice_refund)d" type='action' string='New Refund' states='draft,open' icon="gtk-execute" context="{'invoice_ids': [invoice_id], 'claim_line_ids': claim_line_ids}"/>
<!--<button name="(action_exchange_from_returned_lines)d" string="New exchange" states="draft,open" type="action" target="new"/> -->
</group>
</page>
<!--
<page string="Product exchange">
<field name="product_exchange_ids" nolabel="1" colspan="4"/>
<button name="(action_picking_out_from_exchange_lines)d" string="New picking OUT from exchange" states="draft,open" type="action" target="new"/>
</page>
page string="Aftersale outsourcing">
<button name="create_picking_out" string="New picking OUT from selected lines" states="draft,open" type="object"/>
</page -->
<!-- page string="Repairs">
<button name="create_repair" string="New picking OUT from selected lines" states="draft,open" type="object"/>
</page -->
<!-- page string="Loans">
<button name="create_loan" string="New picking OUT from selected lines" states="draft,open" type="object"/>
</page -->
<!-- page string="Financial management">
<!separator string="Costs and Incomes" colspan="4"/>
<field name="planned_revenue"/>
<field name="planned_cost"/>
<field name="real_revenue" readonly="1"/>
<field name="real_cost" readonly="1"/ -->
<!-- /page -->
</page>
<field name="description" position="after">
<group name="Product Return" colspan="4">
<separator string="Product Return" colspan="4"/>
<field name="invoice_id" colspan="1" on_change="onchange_invoice_id(invoice_id, context)" domain="[('partner_id','=',partner_id)]" />
<button name="%(action_create_return_serial)d" string="Mass return from serial/lot n°" states="draft,open" type="action" target="new"/>
<field name="claim_line_ids" nolabel="1" colspan="3"/>
<group col="1" colspan="1">
<separator string="Action" colspan="1"/>
<button name="%(action_claim_picking_in)d" string="New picking IN" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
<button name="%(action_claim_picking_out)d" string="New picking OUT" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id, 'customer_id': partner_id}"/>
<button name="%(action_claim_picking_loss)d" string="New Product Loss" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
<button name="%(account.action_account_invoice_refund)d"
type='action' string='New Refund'
states='draft,open' icon="gtk-execute"
context="{'invoice_ids': [invoice_id], 'claim_line_ids': claim_line_ids, 'description': name}"/>
</group>
</group>
</field>
</field>
</record>
<record model="ir.ui.view" id="crm_claim_rma_form_view2">

View File

@@ -29,6 +29,17 @@ class account_invoice_refund(osv.osv_memory):
context['active_ids'] = context.get('invoice_ids')
return super(account_invoice_refund, self).compute_refund(cr, uid, ids, mode='refund', context=context)
def _get_description(self, cr, uid, context=None):
if context is None: context = {}
return context.get('description', '')
_defaults = {
'description': _get_description,
}
account_invoice_refund()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: