Merge lp:~openerp-dev/openobject-addons/6.1-opw-576212-jap into lp:openobject-addons/6.1

Proposed by Jagdish Panchal (Open ERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6866
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576212-jap
Merge into: lp:openobject-addons/6.1
Diff against target: 31 lines (+6/-3)
2 files modified
account/account.py (+1/-0)
stock_invoice_directly/wizard/stock_invoice.py (+5/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-576212-jap
Reviewer Review Type Date Requested Status
Jagdish Panchal (Open ERP) (community) Needs Resubmitting
Naresh(OpenERP) (community) Needs Fixing
Priyesh (OpenERP) (community) Needs Fixing
Review via email: mp+112541@code.launchpad.net

Description of the change

Hello,

Steps to Reproduce the issue:

1) Install stock_invoice_directly module.

2) Create a po with a product: say for example PC1 with quantity=10. A picking is created.
   Invoice Policy: Based on receptions

3) Go Incoming Shipments, deliver 3 products and create invoice.
   invoice will be created with quantity 7(undelivered quantity).

This MP contains fix for this issue

Thanks

To post a comment you must log in.
Revision history for this message
Priyesh (OpenERP) (pso-openerp) wrote :

Thanks for fix, Jagdish. It works fine.

review: Approve
Revision history for this message
Priyesh (OpenERP) (pso-openerp) wrote :

Hello Jagdish,

I got 2 more errors while making more test cases on this, as below:

On a full shipment it is coming with this error:
ProgrammingError: operator does not exist: integer = boolean
LINE 1: ...ng.id FROM "stock_picking" WHERE stock_picking.id IN (false)...
                                                             ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

On a partial shipment the first shipment works fine, but the last shipment is raising this error:
Warning !
This picking list does not require invoicing.

Kindly fix this and resubmit it.

Thanks,
Priyesh

review: Needs Fixing
Revision history for this message
Jagdish Panchal (Open ERP) (jap-openerp) wrote :

Hello Sir,

Improved code as per your suggestion.

Thanks,

review: Needs Resubmitting
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello
Please improve the code something like this.

context.update(active_model='stock.picking',active_ids=[partial.picking_id.id],active_id=partial.picking_id.id)
if partial.picking_id.backorder_id.id:
   if partial.picking_id.backorder_id.invoice_state != 'done' and partial.picking_id.state !='done':
        context.update(active_model='stock.picking', active_ids=[partial.picking_id.backorder_id.id],
                       active_id=partial.picking_id.backorder_id.id)

Note: not tested.

Thanks,
Naresh Soni

review: Needs Fixing
6866. By Jagdish Panchal (Open ERP)

[IMP] stock_invoice_directly: improve the code

Revision history for this message
Jagdish Panchal (Open ERP) (jap-openerp) wrote :

Hello Sir,

Improved code as per your suggestion.

Thanks,
JAP

review: Needs Resubmitting
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576212-port-mma/+merge/137148 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

6867. By Jagdish Panchal (Open ERP)

[FIX] test

Unmerged revisions

6867. By Jagdish Panchal (Open ERP)

[FIX] test

6866. By Jagdish Panchal (Open ERP)

[IMP] stock_invoice_directly: improve the code

6865. By Jagdish Panchal (Open ERP)

[FIX] stock_invoice_directly: Fix the warring when creating invoice of last shipment: (Maintenance Case : 576212)

6864. By Jagdish Panchal (Open ERP)

[FIX] stock_invoice_directly: Fix the issue wrong quantity invoice created: (Maintenance Case : 576212)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2012-10-09 09:58:14 +0000
+++ account/account.py 2012-12-28 10:51:26 +0000
@@ -87,6 +87,7 @@
87 next_date += relativedelta(day=line.days2, months=1)87 next_date += relativedelta(day=line.days2, months=1)
88 result.append( (next_date.strftime('%Y-%m-%d'), amt) )88 result.append( (next_date.strftime('%Y-%m-%d'), amt) )
89 amount -= amt89 amount -= amt
90
90 return result91 return result
9192
92account_payment_term()93account_payment_term()
9394
=== modified file 'stock_invoice_directly/wizard/stock_invoice.py'
--- stock_invoice_directly/wizard/stock_invoice.py 2011-10-16 01:28:00 +0000
+++ stock_invoice_directly/wizard/stock_invoice.py 2012-12-28 10:51:26 +0000
@@ -29,10 +29,12 @@
29 after processing the partial picking.29 after processing the partial picking.
30 """30 """
31 if context is None: context = {}31 if context is None: context = {}
32 result = super(invoice_directly, self).do_partial(cr, uid, ids, context)32 result = super(invoice_directly, self).do_partial(cr, uid, ids, context=context)
33 partial = self.browse(cr, uid, ids[0], context)33 partial = self.browse(cr, uid, ids[0], context)
34 context.update(active_model='stock.picking',34 context.update(active_model='stock.picking',active_ids=[partial.picking_id.id],active_id=partial.picking_id.id)
35 active_ids=[partial.picking_id.id])35 if partial.picking_id.backorder_id.id:
36 if partial.picking_id.backorder_id.invoice_state != 'done' and partial.picking_id.state !='done':
37 context.update(active_model='stock.picking', active_ids=[partial.picking_id.backorder_id.id], active_id=partial.picking_id.backorder_id.id)
36 if partial.picking_id.invoice_state == '2binvoiced':38 if partial.picking_id.invoice_state == '2binvoiced':
37 return {39 return {
38 'name': 'Create Invoice',40 'name': 'Create Invoice',