From 10868c2eb50437d6e1ad0917791792e4e5cccc00 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Thu, 16 Dec 2010 17:30:25 +0100 Subject: [PATCH] [IMP] sale_margin: replaced tabs with 4 spaces in view and removed the button 'create invoice' in order to reuse the one defined in the first tab bzr revid: qdp-launchpad@tinyerp.com-20101216163025-x1rbfsd4bcrxgdu9 --- addons/sale_margin/sale_margin.py | 10 +- addons/sale_margin/sale_margin_view.xml | 152 ++++++++++++------------ 2 files changed, 79 insertions(+), 83 deletions(-) diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index fdf7eaf69e4..cd327834185 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -76,16 +76,16 @@ class stock_picking(osv.osv): 'invoice_ids': fields.many2many('account.invoice', 'picking_invoice_rel', 'picking_id', 'invoice_id', 'Invoices', domain=[('type', '=', 'out_invoice')]), } - def create_invoice(self, cr, uid, ids, *args): + def action_invoice_create(self, cr, uid, ids, journal_id=False, + group=False, type='out_invoice', context=None): # need to carify with new requirement invoice_ids = [] - margin_deduce = 0.0 picking_obj = self.pool.get('stock.picking') - picking_obj.write(cr, uid, ids, {'invoice_state': '2binvoiced'}) - res = picking_obj.action_invoice_create(cr, uid, ids, type='out_invoice', context={}) + res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=False, + group=False, type='out_invoice', context=None) invoice_ids = res.values() picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]}) - return True + return res stock_picking() diff --git a/addons/sale_margin/sale_margin_view.xml b/addons/sale_margin/sale_margin_view.xml index 47cbe4c2878..201dd12d7a0 100644 --- a/addons/sale_margin/sale_margin_view.xml +++ b/addons/sale_margin/sale_margin_view.xml @@ -2,84 +2,80 @@ - - sale.order.margin.view.form - form - sale.order - - - - - - - - - - sale.order.line.margin.view.form - form - sale.order - - - - - - - - - - sale.order.line.tree.margin.view.form - form - sale.order - - - - - - - - - - sale.order.margin.view.tree - tree - sale.order - - - - - - - - - - sale.order.margin.line.view.tree - tree - sale.order.line - - - - - - - - + + sale.order.margin.view.form + form + sale.order + + + + + + + + + + sale.order.line.margin.view.form + form + sale.order + + + + + + + + + + sale.order.line.tree.margin.view.form + form + sale.order + + + + + + + + + + sale.order.margin.view.tree + tree + sale.order + + + + + + + + + + sale.order.margin.line.view.tree + tree + sale.order.line + + + + + + + + + + + picking.margin.view.form + form + stock.picking + + + + + + + + + - - picking.margin.view.form - form - stock.picking - - - - - - -