Merge lp:~openerp-dev/openobject-addons/trunk-many2oneview-dle into lp:openobject-addons

Proposed by Denis Ledoux (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-many2oneview-dle
Merge into: lp:openobject-addons
Diff against target: 95 lines (+7/-40)
3 files modified
account/account_invoice.py (+2/-13)
crm/crm_lead.py (+4/-6)
mail/mail_thread.py (+1/-21)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-many2oneview-dle
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+207245@code.launchpad.net
To post a comment you must log in.
9087. By Niko (OpenERP)

[IMP] Add some video to manisfest ( website, website_blog, website_event, website_ecommerce)

Unmerged revisions

9156. By Denis Ledoux (OpenERP)

[FIX] *: replace overwrite methods get_formview_action by get_formview_id, new factorised method of get_formview_action

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2014-01-08 09:36:59 +0000
3+++ account/account_invoice.py 2014-02-19 16:30:30 +0000
4@@ -680,25 +680,14 @@
5 self.create_workflow(cr, uid, ids)
6 return True
7
8- # ----------------------------------------
9- # Mail related methods
10- # ----------------------------------------
11-
12- def _get_formview_action(self, cr, uid, id, context=None):
13+ def get_formview_id(self, cr, uid, id, context=None):
14 """ Update form view id of action to open the invoice """
15- action = super(account_invoice, self)._get_formview_action(cr, uid, id, context=context)
16 obj = self.browse(cr, uid, id, context=context)
17 if obj.type == 'in_invoice':
18 model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_supplier_form')
19- action.update({
20- 'views': [(view_id, 'form')],
21- })
22 else:
23 model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form')
24- action.update({
25- 'views': [(view_id, 'form')],
26- })
27- return action
28+ return view_id
29
30 # Workflow stuff
31 #################
32
33=== modified file 'crm/crm_lead.py'
34--- crm/crm_lead.py 2014-02-12 09:10:46 +0000
35+++ crm/crm_lead.py 2014-02-19 16:30:30 +0000
36@@ -967,15 +967,13 @@
37 return [lead.section_id.message_get_reply_to()[0] if lead.section_id else False
38 for lead in self.browse(cr, SUPERUSER_ID, ids, context=context)]
39
40- def _get_formview_action(self, cr, uid, id, context=None):
41- action = super(crm_lead, self)._get_formview_action(cr, uid, id, context=context)
42+ def get_formview_id(self, cr, uid, id, context=None):
43 obj = self.browse(cr, uid, id, context=context)
44 if obj.type == 'opportunity':
45 model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'crm_case_form_view_oppor')
46- action.update({
47- 'views': [(view_id, 'form')],
48- })
49- return action
50+ else:
51+ view_id = super(crm_lead, self).get_formview_id(cr, uid, id, model=model, context=context)
52+ return view_id
53
54 def message_get_suggested_recipients(self, cr, uid, ids, context=None):
55 recipients = super(crm_lead, self).message_get_suggested_recipients(cr, uid, ids, context=context)
56
57=== modified file 'mail/mail_thread.py'
58--- mail/mail_thread.py 2014-02-19 11:13:30 +0000
59+++ mail/mail_thread.py 2014-02-19 16:30:30 +0000
60@@ -563,23 +563,6 @@
61 model_obj.check_access_rights(cr, uid, check_operation)
62 model_obj.check_access_rule(cr, uid, mids, check_operation, context=context)
63
64- def _get_formview_action(self, cr, uid, id, model=None, context=None):
65- """ Return an action to open the document. This method is meant to be
66- overridden in addons that want to give specific view ids for example.
67-
68- :param int id: id of the document to open
69- :param string model: specific model that overrides self._name
70- """
71- return {
72- 'type': 'ir.actions.act_window',
73- 'res_model': model or self._name,
74- 'view_type': 'form',
75- 'view_mode': 'form',
76- 'views': [(False, 'form')],
77- 'target': 'current',
78- 'res_id': id,
79- }
80-
81 def _get_inbox_action_xml_id(self, cr, uid, context=None):
82 """ When redirecting towards the Inbox, choose which action xml_id has
83 to be fetched. This method is meant to be inherited, at least in portal
84@@ -622,10 +605,7 @@
85 if model_obj.check_access_rights(cr, uid, 'read', raise_exception=False):
86 try:
87 model_obj.check_access_rule(cr, uid, [res_id], 'read', context=context)
88- if not hasattr(model_obj, '_get_formview_action'):
89- action = self.pool.get('mail.thread')._get_formview_action(cr, uid, res_id, model=model, context=context)
90- else:
91- action = model_obj._get_formview_action(cr, uid, res_id, context=context)
92+ action = model_obj.get_formview_action(cr, uid, res_id, context=context)
93 except (osv.except_osv, orm.except_orm):
94 pass
95 action.update({

Subscribers

People subscribed via source and target branches

to all changes: