Merge lp:~openerp-community/openobject-addons/contact-id-solution-for-v7-contact-management into lp:openobject-addons/7.0

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Needs review
Proposed branch: lp:~openerp-community/openobject-addons/contact-id-solution-for-v7-contact-management
Merge into: lp:openobject-addons/7.0
Diff against target: 398 lines (+43/-37)
21 files modified
account/account_invoice.py (+1/-1)
account/account_invoice_view.xml (+1/-1)
account/edi/invoice_action_data.xml (+1/-1)
account/report/account_invoice_report.py (+4/-3)
account/report/account_print_invoice.rml (+3/-4)
analytic/analytic.py (+1/-1)
crm/crm_lead.py (+4/-4)
crm/wizard/crm_opportunity_to_phonecall.py (+4/-3)
crm_claim/crm_claim.py (+1/-1)
portal_sale/portal_sale_data.xml (+2/-2)
project/project.py (+1/-1)
purchase/edi/purchase_order_action_data.xml (+1/-1)
purchase/purchase.py (+3/-1)
purchase/report/request_quotation.rml (+1/-1)
sale/edi/sale_order_action_data.xml (+1/-1)
sale/report/sale_order.rml (+2/-2)
sale/sale.py (+3/-2)
sale_crm/wizard/crm_make_sale.py (+2/-2)
sale_stock/sale_stock.py (+2/-1)
stock/report/picking.rml (+3/-3)
stock/stock.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-community/openobject-addons/contact-id-solution-for-v7-contact-management
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Disapprove
Review via email: mp+159320@code.launchpad.net
To post a comment you must log in.
9028. By Sébastien BEAU - http://www.akretion.com

[FIX] fix invoice and picking creation. Wrong the contact should be the contact selected on the sale order, and the partner the commercial_entity related to this contact

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Please see my comment on the server merge proposal this branch depends on:
  https://code.launchpad.net/~openerp-community/openobject-server/contact-id-solution-for-v7-contact-management/+merge/159316

In addition:

- l.178,207: the fact that you need to specifically follow ".commercial_entity_id" illustrates the problem of the mixin not dealing properly with multiple partner fields in the original model (as mentioned in the server MP review)
- l.236: shouldn't that be 'contact_id' rather than 'contact'?

review: Disapprove
9029. By Raphaël Valyi - http://www.akretion.com

[FIX] green on all email, #SorrySAP ;)

9030. By njeudy

[FIX] more account invoice report polish for contact_id

9031. By Sébastien BEAU - http://www.akretion.com

[IMP] improve reporting on invoice, now we can also group by and filter by contact

9032. By Sébastien BEAU - http://www.akretion.com

[REF] remove contact_id as mixin already add it

9033. By njeudy

[FIX] this should fix picking reports for contact_id

9034. By Raphaël Valyi - http://www.akretion.com

[FIX] contact_id solution: contact_id is optional, fall back on partner_id

9035. By Sébastien BEAU - http://www.akretion.com

[FIX] opening the invoice from the res.partner is now possible

9036. By Raphaël Valyi - http://www.akretion.com

[FIX] green on CRM: meeting and phone calls for contacts. Yeahbzr diff crm we can finally call ourselves a true ERP... beware SAP the end is near...

9037. By Raphaël Valyi - http://www.akretion.com

[FIX] contact mixin for account.analytic.account, project.project and crm.claim. I consider all objects who should get a contact mixin have it now

Unmerged revisions

9037. By Raphaël Valyi - http://www.akretion.com

[FIX] contact mixin for account.analytic.account, project.project and crm.claim. I consider all objects who should get a contact mixin have it now

9036. By Raphaël Valyi - http://www.akretion.com

[FIX] green on CRM: meeting and phone calls for contacts. Yeahbzr diff crm we can finally call ourselves a true ERP... beware SAP the end is near...

9035. By Sébastien BEAU - http://www.akretion.com

[FIX] opening the invoice from the res.partner is now possible

9034. By Raphaël Valyi - http://www.akretion.com

[FIX] contact_id solution: contact_id is optional, fall back on partner_id

9033. By njeudy

[FIX] this should fix picking reports for contact_id

9032. By Sébastien BEAU - http://www.akretion.com

[REF] remove contact_id as mixin already add it

9031. By Sébastien BEAU - http://www.akretion.com

[IMP] improve reporting on invoice, now we can also group by and filter by contact

9030. By njeudy

[FIX] more account invoice report polish for contact_id

9029. By Raphaël Valyi - http://www.akretion.com

[FIX] green on all email, #SorrySAP ;)

9028. By Sébastien BEAU - http://www.akretion.com

[FIX] fix invoice and picking creation. Wrong the contact should be the contact selected on the sale order, and the partner the commercial_entity related to this contact

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 2013-04-18 15:40:22 +0000
3+++ account/account_invoice.py 2013-04-21 22:51:24 +0000
4@@ -184,7 +184,7 @@
5 return invoice_ids
6
7 _name = "account.invoice"
8- _inherit = ['mail.thread']
9+ _inherit = ['mail.thread', 'res.contact.mixin']
10 _description = 'Invoice'
11 _order = "id desc"
12 _track = {
13
14=== modified file 'account/account_invoice_view.xml'
15--- account/account_invoice_view.xml 2013-04-10 13:53:08 +0000
16+++ account/account_invoice_view.xml 2013-04-21 22:51:24 +0000
17@@ -622,7 +622,7 @@
18 </record>
19 <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
20
21- <act_window context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
22+ <act_window domain="['|', ['partner_id', '=', active_id], ['contact_id', '=', active_id]]" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
23
24 <act_window
25 id="act_account_journal_2_account_invoice_opened"
26
27=== modified file 'account/edi/invoice_action_data.xml'
28--- account/edi/invoice_action_data.xml 2012-12-14 11:31:32 +0000
29+++ account/edi/invoice_action_data.xml 2013-04-21 22:51:24 +0000
30@@ -24,7 +24,7 @@
31 <field name="name">Invoice - Send by Email</field>
32 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
33 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
34- <field name="email_recipients">${object.partner_id.id}</field>
35+ <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
36 <field name="model_id" ref="account.model_account_invoice"/>
37 <field name="auto_delete" eval="True"/>
38 <field name="report_template" ref="account_invoices"/>
39
40=== modified file 'account/report/account_invoice_report.py'
41--- account/report/account_invoice_report.py 2013-03-21 18:55:41 +0000
42+++ account/report/account_invoice_report.py 2013-04-21 22:51:24 +0000
43@@ -26,6 +26,7 @@
44 class account_invoice_report(osv.osv):
45 _name = "account.invoice.report"
46 _description = "Invoices Statistics"
47+ _inherit = ['res.contact.mixin']
48 _auto = False
49 _rec_name = 'date'
50
51@@ -103,7 +104,7 @@
52
53 def _select(self):
54 select_str = """
55- SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id,
56+ SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id, sub.contact_id,
57 sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
58 sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
59 sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
60@@ -119,7 +120,7 @@
61 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,
62 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text) AS month,
63 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text) AS day,
64- ail.product_id, ai.partner_id, ai.payment_term, ai.period_id,
65+ ail.product_id, ai.partner_id, ai.contact_id, ai.payment_term, ai.period_id,
66 CASE
67 WHEN u.uom_type::text <> 'reference'::text
68 THEN ( SELECT product_uom.name
69@@ -190,7 +191,7 @@
70 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),
71 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),
72 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text),
73- ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
74+ ai.partner_id, ai.contact_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
75 ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
76 ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
77 ai.amount_total, u.uom_type, u.category_id
78
79=== modified file 'account/report/account_print_invoice.rml'
80--- account/report/account_print_invoice.rml 2013-03-26 17:02:58 +0000
81+++ account/report/account_print_invoice.rml 2013-04-21 22:51:24 +0000
82@@ -161,13 +161,12 @@
83 </para>
84 </td>
85 <td>
86- <para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
87- <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
88+ <para style="terp_default_8">[[ display_address(o.contact_id or o.partner_id) ]]</para>
89 <para style="terp_default_8">
90 <font color="white"> </font>
91 </para>
92- <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
93- <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
94+ <para style="terp_default_8">Tel. : [[ (o.contact_id and o.contact_id.phone or o.partner_id.phone) or removeParentNode('para') ]]</para>
95+ <para style="terp_default_8">Fax : [[ (o.contact_id and o.contact_id.fax or o.partner_id.fax) or removeParentNode('para') ]]</para>
96 <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
97 </td>
98 </tr>
99
100=== modified file 'analytic/analytic.py'
101--- analytic/analytic.py 2013-04-10 12:20:11 +0000
102+++ analytic/analytic.py 2013-04-21 22:51:24 +0000
103@@ -29,7 +29,7 @@
104
105 class account_analytic_account(osv.osv):
106 _name = 'account.analytic.account'
107- _inherit = ['mail.thread']
108+ _inherit = ['mail.thread', 'res.contact.mixin']
109 _description = 'Analytic Account'
110 _track = {
111 'state': {
112
113=== modified file 'crm/crm_lead.py'
114--- crm/crm_lead.py 2013-04-17 09:09:25 +0000
115+++ crm/crm_lead.py 2013-04-21 22:51:24 +0000
116@@ -72,7 +72,7 @@
117 _name = "crm.lead"
118 _description = "Lead/Opportunity"
119 _order = "priority,date_action,id desc"
120- _inherit = ['mail.thread', 'ir.needaction_mixin']
121+ _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
122
123 _track = {
124 'state': {
125@@ -240,7 +240,6 @@
126 _columns = {
127 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
128 select=True, help="Linked partner (optional). Usually created when converting the lead."),
129-
130 'id': fields.integer('ID', readonly=True),
131 'name': fields.char('Subject', size=64, required=True, select=1),
132 'active': fields.boolean('Active', required=False),
133@@ -911,10 +910,11 @@
134 """
135 opportunity = self.browse(cr, uid, ids[0], context)
136 res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context)
137+ default_partner_id = opportunity.contact_id and opportunity.contact_id.id or opportunity.partner_id and opportunity.partner_id.id or False
138 res['context'] = {
139 'default_opportunity_id': opportunity.id,
140- 'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False,
141- 'default_partner_ids' : opportunity.partner_id and [opportunity.partner_id.id] or False,
142+ 'default_partner_id': default_partner_id,
143+ 'default_partner_ids' : default_partner_id and [default_partner_id] or False,
144 'default_user_id': uid,
145 'default_section_id': opportunity.section_id and opportunity.section_id.id or False,
146 'default_email_from': opportunity.email_from,
147
148=== modified file 'crm/wizard/crm_opportunity_to_phonecall.py'
149--- crm/wizard/crm_opportunity_to_phonecall.py 2013-03-07 16:28:51 +0000
150+++ crm/wizard/crm_opportunity_to_phonecall.py 2013-04-21 22:51:24 +0000
151@@ -42,6 +42,7 @@
152 res = {}
153 res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
154 for opp in opp_obj.browse(cr, uid, record_ids, context=context):
155+ contact = opp.contact_id or opp.partner_id
156 if 'name' in fields:
157 res.update({'name': opp.name})
158 if 'user_id' in fields:
159@@ -51,11 +52,11 @@
160 if 'categ_id' in fields:
161 res.update({'categ_id': categ_id})
162 if 'partner_id' in fields:
163- res.update({'partner_id': opp.partner_id and opp.partner_id.id or False})
164+ res.update({'partner_id': contact and contact.id or False})
165 if 'contact_name' in fields:
166- res.update({'contact_name': opp.partner_id and opp.partner_id.name or False})
167+ res.update({'contact_name': contact and contact.name or False})
168 if 'phone' in fields:
169- res.update({'phone': opp.phone or (opp.partner_id and opp.partner_id.phone or False)})
170+ res.update({'phone': opp.phone or (contact and contact.phone or False)})
171 return res
172
173 def action_schedule(self, cr, uid, ids, context=None):
174
175=== modified file 'crm_claim/crm_claim.py'
176--- crm_claim/crm_claim.py 2013-01-15 13:43:59 +0000
177+++ crm_claim/crm_claim.py 2013-04-21 22:51:24 +0000
178@@ -72,7 +72,7 @@
179 _name = "crm.claim"
180 _description = "Claim"
181 _order = "priority,date desc"
182- _inherit = ['mail.thread']
183+ _inherit = ['mail.thread', 'res.contact.mixin']
184
185 _columns = {
186 'id': fields.integer('ID', readonly=True),
187
188=== modified file 'portal_sale/portal_sale_data.xml'
189--- portal_sale/portal_sale_data.xml 2012-12-21 16:48:08 +0000
190+++ portal_sale/portal_sale_data.xml 2013-04-21 22:51:24 +0000
191@@ -8,7 +8,7 @@
192 <field name="name">Sales Order - Send by Email (Portal)</field>
193 <field name="email_from">${object.user_id.email or ''}</field>
194 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
195- <field name="email_recipients">${object.partner_invoice_id.id}</field>
196+ <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_invoice_id.id}</field>
197 <field name="model_id" ref="sale.model_sale_order"/>
198 <field name="auto_delete" eval="True"/>
199 <field name="report_template" ref="sale.report_sale_order"/>
200@@ -97,7 +97,7 @@
201 <field name="name">Invoice - Send by Email (Portal)</field>
202 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
203 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
204- <field name="email_recipients">${object.partner_id.id}</field>
205+ <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
206 <field name="model_id" ref="account.model_account_invoice"/>
207 <field name="auto_delete" eval="True"/>
208 <field name="report_template" ref="account.account_invoices"/>
209
210=== modified file 'project/project.py'
211--- project/project.py 2013-04-12 14:37:19 +0000
212+++ project/project.py 2013-04-21 22:51:24 +0000
213@@ -77,7 +77,7 @@
214 _description = "Project"
215 _inherits = {'account.analytic.account': "analytic_account_id",
216 "mail.alias": "alias_id"}
217- _inherit = ['mail.thread', 'ir.needaction_mixin']
218+ _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin.methods']
219
220 def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
221 if user == 1:
222
223=== modified file 'purchase/edi/purchase_order_action_data.xml'
224--- purchase/edi/purchase_order_action_data.xml 2013-03-08 14:24:48 +0000
225+++ purchase/edi/purchase_order_action_data.xml 2013-04-21 22:51:24 +0000
226@@ -21,7 +21,7 @@
227 <field name="name">Purchase Order - Send by mail</field>
228 <field name="email_from">${object.validator.email or ''}</field>
229 <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
230- <field name="email_recipients">${object.partner_id.id}</field>
231+ <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
232 <field name="model_id" ref="purchase.model_purchase_order"/>
233 <field name="auto_delete" eval="True"/>
234 <field name="report_template" ref="report_purchase_quotation"/>
235
236=== modified file 'purchase/purchase.py'
237--- purchase/purchase.py 2013-04-09 12:25:30 +0000
238+++ purchase/purchase.py 2013-04-21 22:51:24 +0000
239@@ -242,7 +242,7 @@
240 ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'),
241 ]
242 _name = "purchase.order"
243- _inherit = ['mail.thread', 'ir.needaction_mixin']
244+ _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
245 _description = "Purchase Order"
246 _order = "name desc"
247
248@@ -542,6 +542,7 @@
249 'reference': order.partner_ref or order.name,
250 'account_id': pay_acc_id,
251 'type': 'in_invoice',
252+ 'contact_id': order.contact_id and order.contact_id.id,
253 'partner_id': order.partner_id.id,
254 'currency_id': order.pricelist_id.currency_id.id,
255 'journal_id': len(journal_ids) and journal_ids[0] or False,
256@@ -624,6 +625,7 @@
257 'origin': order.name + ((order.origin and (':' + order.origin)) or ''),
258 'date': self.date_to_datetime(cr, uid, order.date_order, context),
259 'partner_id': order.dest_address_id.id or order.partner_id.id,
260+ 'contact_id': order.contact_id and order.contact_id.id,
261 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
262 'type': 'in',
263 'partner_id': order.dest_address_id.id or order.partner_id.id,
264
265=== modified file 'purchase/report/request_quotation.rml'
266--- purchase/report/request_quotation.rml 2012-12-15 16:23:09 +0000
267+++ purchase/report/request_quotation.rml 2013-04-21 22:51:24 +0000
268@@ -101,7 +101,7 @@
269 </td>
270 <td>
271 <para style="terp_default_9">[[ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ (order .partner_id and order.partner_id.name) or '' ]] </para>
272- <para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para>
273+ <para style="terp_default_9">[[ display_address(order.contact_id or order.partner_id) ]] </para>
274 <para style="terp_default_9">
275 <font color="white"> </font>
276 </para>
277
278=== modified file 'purchase/report/request_quotation.sxw'
279Binary files purchase/report/request_quotation.sxw 2012-12-08 10:33:38 +0000 and purchase/report/request_quotation.sxw 2013-04-21 22:51:24 +0000 differ
280=== modified file 'sale/edi/sale_order_action_data.xml'
281--- sale/edi/sale_order_action_data.xml 2012-12-21 16:48:08 +0000
282+++ sale/edi/sale_order_action_data.xml 2013-04-21 22:51:24 +0000
283@@ -22,7 +22,7 @@
284 <field name="name">Sales Order - Send by Email</field>
285 <field name="email_from">${object.user_id.email or ''}</field>
286 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
287- <field name="email_recipients">${object.partner_invoice_id.id}</field>
288+ <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_invoice_id.id}</field>
289 <field name="model_id" ref="sale.model_sale_order"/>
290 <field name="auto_delete" eval="True"/>
291 <field name="report_template" ref="report_sale_order"/>
292
293=== modified file 'sale/report/sale_order.rml'
294--- sale/report/sale_order.rml 2013-03-18 13:56:54 +0000
295+++ sale/report/sale_order.rml 2013-04-21 22:51:24 +0000
296@@ -178,8 +178,8 @@
297 </para>
298 </td>
299 <td>
300- <para style="terp_default_9">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
301- <para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para>
302+ <para style="terp_default_9">[[ (o.contact_id and o.contact_id.title and o.contact_id.title.name) or '' ]] [[ (o.contact_id and o.contact_id.name) or '' ]]</para>
303+ <para style="terp_default_9">[[ o.contact_id and display_address(o.contact_id) ]] </para>
304 <para style="terp_default_9">
305 <font color="white"> </font>
306 </para>
307
308=== modified file 'sale/report/sale_order.sxw'
309Binary files sale/report/sale_order.sxw 2013-03-18 13:56:54 +0000 and sale/report/sale_order.sxw 2013-04-21 22:51:24 +0000 differ
310=== modified file 'sale/sale.py'
311--- sale/sale.py 2013-04-18 17:21:23 +0000
312+++ sale/sale.py 2013-04-21 22:51:24 +0000
313@@ -47,7 +47,7 @@
314
315 class sale_order(osv.osv):
316 _name = "sale.order"
317- _inherit = ['mail.thread', 'ir.needaction_mixin']
318+ _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
319 _description = "Sales Order"
320 _track = {
321 'state': {
322@@ -368,7 +368,8 @@
323 'type': 'out_invoice',
324 'reference': order.client_order_ref or order.name,
325 'account_id': order.partner_id.property_account_receivable.id,
326- 'partner_id': order.partner_invoice_id.id,
327+ 'contact_id': order.partner_invoice_id.id,
328+ 'partner_id': order.partner_invoice_id.commercial_entity_id.id,
329 'journal_id': journal_ids[0],
330 'invoice_line': [(6, 0, lines)],
331 'currency_id': order.pricelist_id.currency_id.id,
332
333=== modified file 'sale_crm/wizard/crm_make_sale.py'
334--- sale_crm/wizard/crm_make_sale.py 2012-12-21 16:48:08 +0000
335+++ sale_crm/wizard/crm_make_sale.py 2013-04-21 22:51:24 +0000
336@@ -46,8 +46,8 @@
337 if not active_id:
338 return False
339
340- lead = lead_obj.read(cr, uid, active_id, ['partner_id'])
341- return lead['partner_id']
342+ lead = lead_obj.read(cr, uid, active_id, ['contact_id'])
343+ return lead['contact_id']
344
345 def view_init(self, cr, uid, fields_list, context=None):
346 return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)
347
348=== modified file 'sale_stock/sale_stock.py'
349--- sale_stock/sale_stock.py 2013-04-09 12:25:30 +0000
350+++ sale_stock/sale_stock.py 2013-04-21 22:51:24 +0000
351@@ -344,7 +344,8 @@
352 'state': 'auto',
353 'move_type': order.picking_policy,
354 'sale_id': order.id,
355- 'partner_id': order.partner_shipping_id.id,
356+ 'contact_id': order.partner_shipping_id.id,
357+ 'partner_id': order.partner_shipping_id.commercial_entity_id.id,
358 'note': order.note,
359 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none',
360 'company_id': order.company_id.id,
361
362=== modified file 'stock/report/picking.rml'
363--- stock/report/picking.rml 2013-03-06 15:36:19 +0000
364+++ stock/report/picking.rml 2013-04-21 22:51:24 +0000
365@@ -168,9 +168,9 @@
366 </td>
367 <td>
368 <para style="terp_default_Bold_9">Contact Address :</para>
369- <para style="terp_default_9">[[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]]</para>
370- <para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]] </para>
371- <para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
372+ <para style="terp_default_9">[[ picking.contact_id and picking.contact_id.title.name or picking.partner_id and picking.partner_id.title.name or '']] [[ picking.contact_id and picking.contact_id.name or picking.partner_id.name or '' ]]</para>
373+ <para style="terp_default_9">[[ picking.partner_id and display_address(picking.contact_id or picking.partner_id) ]] </para>
374+ <para style="terp_default_9">[[ picking.contact_id and picking.contact_id.phone or picking.contact_id.email or picking.partner_id and picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
375 </td>
376 </tr>
377 </blockTable>
378
379=== modified file 'stock/stock.py'
380--- stock/stock.py 2013-04-05 15:30:21 +0000
381+++ stock/stock.py 2013-04-21 22:51:24 +0000
382@@ -545,7 +545,7 @@
383 #----------------------------------------------------------
384 class stock_picking(osv.osv):
385 _name = "stock.picking"
386- _inherit = ['mail.thread']
387+ _inherit = ['mail.thread', 'res.contact.mixin']
388 _description = "Picking List"
389
390 def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):
391@@ -1026,6 +1026,7 @@
392 'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
393 'type': inv_type,
394 'account_id': account_id,
395+ 'contact': picking.contact_id and picking.contact_id.id,
396 'partner_id': partner.id,
397 'comment': comment,
398 'payment_term': payment_term,