Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-574927-msh into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574927-msh/+merge/108294

Hello,

Fixed the issue of res.log, res log of customer invoice payment opens the view 
of supplier invoice.

Demo :- Create Customer Invoice and Pay it -> when you pay invoice you will get 
res.log 'Invoice SAJ/.../.. is paid' but when you click it you will get 
supplier invoice.

Reason :- Here res,log is created from the workflow method and currently 
workflow method does not support context, context will not be passed from any 
workflow method so we can not determined the type, that whether it is 
in_invoice or out_invoice, so call the read and get the type and changed the 
string from overwritten fields_view_get.

Thanks.


-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574927-msh/+merge/108294
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-574927-msh.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-03-29 15:43:31 +0000
+++ account/account_invoice.py	2012-06-01 07:11:18 +0000
@@ -345,6 +345,13 @@
             for node in doc.xpath("//field[@name='partner_id']"):
                 node.set('string', partner_string)
             res['arch'] = etree.tostring(doc)
+        if view_type == 'form':
+            form_string = "Supplier Invoices"
+            if context.get('type','in_invoice') in ('out_invoice', 'out_refund'):
+                form_string = "Customer Invoices"
+            for node in doc.xpath("//form"):
+                node.set('string', form_string)
+            res['arch'] = etree.tostring(doc)
         return res
 
     def get_log_context(self, cr, uid, context=None):
@@ -378,9 +385,10 @@
         if context is None:
             context = {}
         self.write(cr, uid, ids, {'state':'paid'}, context=context)
-        for inv_id, name in self.name_get(cr, uid, ids, context=context):
-            message = _("Invoice '%s' is paid.") % name
-            self.log(cr, uid, inv_id, message)
+        for inv in self.read(cr, uid, ids, context=context):
+            message = _("Invoice '%s' is paid.") % inv['number']
+            context['type'] = str(inv['type'])
+            self.log(cr, uid, ids[0], message, context=context)
         return True
 
     def unlink(self, cr, uid, ids, context=None):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to