Logical error on printing/re-printing invoice

Bug #404975 reported by Christophe CRIER
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Harry (OpenERP)

Bug Description

OpenERP-Server Version : 5.0.1
Normaly if you reprinting an invoice when you have already printed one time, OpenERP resend to you the first version of invoice (if you have let the 'attachment_use' field filled).
This functionnality works only in you have put an invoice description. If you doesn't filled the description field, OpenERP recreate the requested invoice on the fly.
I propose to modify 'document.py' file like bellow:
--------------------------------
diff --git a/addons/document/document.py b/addons/document/document.py
index 1a66145..dd36fd7 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -667,7 +667,8 @@ class document_file(osv.osv):
             result = obj_model.read(cr, uid, [vals['res_id']], context=context)
             if len(result):
                 obj=result[0]
- vals['title'] = (obj.get('name',''))[:60]
+ if obj.get('name',''): #[HNM] without this test If 'Description' field of invoice object isn't filled you cannot create attachment.
+ vals['title'] = (obj.get('name',''))[:60]
                 if obj_model._name=='res.partner':
                     vals['partner_id']=obj['id']
                 elif obj.get('address_id',False):
------------------------------

Regards

Related branches

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: nobody → Harry (Open ERP) (hmo-tinyerp)
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Thanks to reporting and patch.
Fix Release :
revision-id: <email address hidden>
date: 2009-08-03 16:14:40 +0530
build-date: 2009-08-03 16:15:15 +0530
revno: 2405
branch : openobject-addons/5.0/
branch-nick: 5.0

Changed in openobject-addons:
status: New → Fix Released
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.