[FIX] remove sale_margin unused and bugged code
bzr revid: fp@tinyerp.com-20111111082808-eox3s26qeaz6nm7p
This commit is contained in:
parent
2e2aa576d8
commit
baa7727d45
|
@ -81,42 +81,4 @@ class sale_order(osv.osv):
|
|||
|
||||
sale_order()
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
_columns = {
|
||||
'invoice_ids': fields.many2many('account.invoice', 'picking_invoice_rel', 'picking_id', 'invoice_id', 'Invoices', domain=[('type', '=', 'out_invoice')]),
|
||||
}
|
||||
|
||||
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 = []
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id, group=group, type=type, context=context)
|
||||
invoice_ids = res.values()
|
||||
picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]})
|
||||
return res
|
||||
|
||||
stock_picking()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
_inherit = "account.invoice.line"
|
||||
_columns = {
|
||||
'cost_price': fields.float('Cost Price', digits=(16, 2)),
|
||||
}
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.get('product_id', False):
|
||||
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
|
||||
vals['cost_price'] = res[0]['standard_price']
|
||||
return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if vals.get('product_id',False):
|
||||
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
|
||||
vals['cost_price'] = res[0]['standard_price']
|
||||
return super(account_invoice_line, self).create(cr, uid, vals, context)
|
||||
|
||||
account_invoice_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -61,21 +61,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_margin_out_form">
|
||||
<field name="name">picking.margin.view.form</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page[@string='Additional info']" position="after">
|
||||
<page string="Customer Invoices">
|
||||
<field colspan="4" name="invoice_ids" nolabel="1"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue