← Back to team overview

credativ team mailing list archive

[Bug 881337] Re: duplicate key value violates unique constraint "picking_invoice_rel_picking_id_key

 

r5584 is only available in trunk.

This patch is not available versions 6.0.x

You need not remove this part of code, because it need to report.

103 class account_invoice_line(osv.osv):
104     _inherit = "account.invoice.line"
105     _columns = {
106         'cost_price': fields.float('Cost Price', digits=(16, 2)),
107     }
108     def write(self, cr, uid, ids, vals, context=None):
109         if vals.get('product_id', False):
110             res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
111             vals['cost_price'] = res[0]['standard_price']
112         return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
113  
114     def create(self, cr, uid, vals, context=None):
115         if vals.get('product_id',False):
116             res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
117             vals['cost_price'] = res[0]['standard_price']
118         return super(account_invoice_line, self).create(cr, uid, vals, context)
119  
120 account_invoice_line()

-- 
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/881337

Title:
  duplicate key value violates unique constraint
  "picking_invoice_rel_picking_id_key

Status in OpenERP Addons (modules):
  Fix Released

Bug description:
  After install the module sale_margin, can not create a single invoice for several delivery orders.
  Get the following message « duplicate key value violates unique constraint "picking_invoice_rel_picking_id_key" »

  Steps to reproduce : 
  Install module sale_margin
  Create 2 orders for the same customer.
  Go to Warehouse > Warehouse management > Delivery orders.
  Validate the 2 deliveries.
  After go to Sales > Invoicing > Deliveries to invoice. 
  Check the 2 deliveries (for the same customer) and click on action  Create invoice. 
  Select the destination journal and check the option Group by partner. 
  Click on the create button : integrety error appears.

  We work with database version 6.0.2 (server 3441 and addons 4726)

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/881337/+subscriptions