sales line not invoiced after moving the delivery into another delivery order

Bug #799083 reported by Mihai Satmarean
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Low
OpenERP R&D Addons Team 3

Bug Description

perhaps is connected with https://bugs.launchpad.net/bugs/308803

On a freshly installed db with demo data:
profile manufacturing, invoice on delivery, with partial picking and direct delivery
Create two sales orders (SO001 and SO002) for the same client with the same product. Quantities are not important.
The system generates the delivery orders (OUT001 for SO001 and OUT002 for SO002)
Go to Warehouse->Product moves-Deliver products and find the line that belongs to delivery order OUT001 and edit that line: in the Picking-Reference select the delivery order OUT002

The result is that the delivery order OUT001 is now empty and OUT002 has two lines.

Process that order and create invoice.

Problem:
In the sales orders list the sale SO001 picked is 100% and invoiced is 0%; SO002 picked is 100% and invoiced is 100%

Expected result:
In the sales orders list the sale SO001 picked is 100% and invoiced is 100%; SO002 picked is 100% and invoiced is 100%

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello Mihai Boiciuc,

Its fixed in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-799083-mtr branch.
Revision ID: mtr@mtr-20110707072337-1ui802dcrk6zy8eq
Revision no: 4839

It will be merged soon with main addons.

Thanks,
mtr

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Mihai Satmarean (mihai-satmarean) wrote :

Hi,
trying to use your fix gives me this error:

Environment Information :
System : Windows-XP-5.1.2600-SP3
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : ro_RO.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.2
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/openerp-server-6.0.1/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/lib/openerp-server-6.0.1/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/openerp-server-6.0.1/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/openerp-server-6.0.1/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/openerp-server-6.0.1/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 2921, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 3041, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/usr/lib/openerp-server-6.0.1/osv/fields.py", line 793, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "/usr/lib/openerp-server-6.0.1/addons/sale/sale.py", line 128, in _invoiced_rate
    if sale.invoiced:
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 285, in __getattr__
    return self[name]
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 205, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 2921, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/openerp-server-6.0.1/osv/orm.py", line 3041, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/usr/lib/openerp-server-6.0.1/osv/fields.py", line 793, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "/usr/lib/openerp-server-6.0.1/addons/sale/sale.py", line 155, in _invoiced
    cursor.execute('SELECT invoice_id from sale_order_line_invoice_rel where order_line_id IN %s' ,(tuple(ids),))
  File "/usr/lib/openerp-server-6.0.1/sql_db.py", line 78, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/openerp-server-6.0.1/sql_db.py", line 131, in execute
    res = self._obj.execute(query, params)
ProgrammingError: syntax error at or near ")"
ZEILE 1: ...d from sale_order_line_invoice_rel where order_line_id IN ()

Thanks

Changed in openobject-addons:
status: Fix Committed → In Progress
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello Mihai Boiciuc,

The improved fix is at the following revision:-

Its fixed in https://bugs.launchpad.net/openobject-addons/+bug/791087 branch.
Revision ID: mtr@mtr-20110711083229-ch08184dnkf832jw
Revision no: 4840

Thanks,
mtr

Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello,

In the comment #3 I provided the wrong bug link by mistake.Sincere apologises for that.

Its fixed in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-799083-mtr branch.
Revision ID: mtr@mtr-20110711083229-ch08184dnkf832jw
Revision no: 4840

Thanks,
mtr

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello,

Fix is not proper way. I wrote the comment on Merge proposal.

thanks,
mra

Changed in openobject-addons:
status: Fix Committed → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello,

I have improved the fix as per the suggestions in merge proposal.

Its fixed in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-799083-mtr.
Revision ID: mtr@mtr-20110727084343-oqyzgy9tl9xm4b92
Revision no: 4841

Thanks,
mtr

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
milestone: none → 6.1
Changed in openobject-addons:
status: Fix Committed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.