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
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2013-04-18 15:40:22 +0000
+++ account/account_invoice.py 2013-04-21 22:51:24 +0000
@@ -184,7 +184,7 @@
184 return invoice_ids184 return invoice_ids
185185
186 _name = "account.invoice"186 _name = "account.invoice"
187 _inherit = ['mail.thread']187 _inherit = ['mail.thread', 'res.contact.mixin']
188 _description = 'Invoice'188 _description = 'Invoice'
189 _order = "id desc"189 _order = "id desc"
190 _track = {190 _track = {
191191
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml 2013-04-10 13:53:08 +0000
+++ account/account_invoice_view.xml 2013-04-21 22:51:24 +0000
@@ -622,7 +622,7 @@
622 </record>622 </record>
623 <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>623 <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
624624
625 <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"/>625 <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"/>
626626
627 <act_window627 <act_window
628 id="act_account_journal_2_account_invoice_opened"628 id="act_account_journal_2_account_invoice_opened"
629629
=== modified file 'account/edi/invoice_action_data.xml'
--- account/edi/invoice_action_data.xml 2012-12-14 11:31:32 +0000
+++ account/edi/invoice_action_data.xml 2013-04-21 22:51:24 +0000
@@ -24,7 +24,7 @@
24 <field name="name">Invoice - Send by Email</field>24 <field name="name">Invoice - Send by Email</field>
25 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>25 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
26 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>26 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
27 <field name="email_recipients">${object.partner_id.id}</field>27 <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
28 <field name="model_id" ref="account.model_account_invoice"/>28 <field name="model_id" ref="account.model_account_invoice"/>
29 <field name="auto_delete" eval="True"/>29 <field name="auto_delete" eval="True"/>
30 <field name="report_template" ref="account_invoices"/>30 <field name="report_template" ref="account_invoices"/>
3131
=== modified file 'account/report/account_invoice_report.py'
--- account/report/account_invoice_report.py 2013-03-21 18:55:41 +0000
+++ account/report/account_invoice_report.py 2013-04-21 22:51:24 +0000
@@ -26,6 +26,7 @@
26class account_invoice_report(osv.osv):26class account_invoice_report(osv.osv):
27 _name = "account.invoice.report"27 _name = "account.invoice.report"
28 _description = "Invoices Statistics"28 _description = "Invoices Statistics"
29 _inherit = ['res.contact.mixin']
29 _auto = False30 _auto = False
30 _rec_name = 'date'31 _rec_name = 'date'
3132
@@ -103,7 +104,7 @@
103104
104 def _select(self):105 def _select(self):
105 select_str = """106 select_str = """
106 SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id,107 SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id, sub.contact_id,
107 sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,108 sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
108 sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,109 sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
109 sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,110 sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
@@ -119,7 +120,7 @@
119 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,120 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,
120 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text) AS month,121 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text) AS month,
121 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text) AS day,122 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text) AS day,
122 ail.product_id, ai.partner_id, ai.payment_term, ai.period_id,123 ail.product_id, ai.partner_id, ai.contact_id, ai.payment_term, ai.period_id,
123 CASE124 CASE
124 WHEN u.uom_type::text <> 'reference'::text125 WHEN u.uom_type::text <> 'reference'::text
125 THEN ( SELECT product_uom.name126 THEN ( SELECT product_uom.name
@@ -190,7 +191,7 @@
190 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),191 to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),
191 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),192 to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),
192 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text),193 to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text),
193 ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,194 ai.partner_id, ai.contact_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
194 ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,195 ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
195 ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,196 ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
196 ai.amount_total, u.uom_type, u.category_id197 ai.amount_total, u.uom_type, u.category_id
197198
=== modified file 'account/report/account_print_invoice.rml'
--- account/report/account_print_invoice.rml 2013-03-26 17:02:58 +0000
+++ account/report/account_print_invoice.rml 2013-04-21 22:51:24 +0000
@@ -161,13 +161,12 @@
161 </para>161 </para>
162 </td>162 </td>
163 <td>163 <td>
164 <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>164 <para style="terp_default_8">[[ display_address(o.contact_id or o.partner_id) ]]</para>
165 <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
166 <para style="terp_default_8">165 <para style="terp_default_8">
167 <font color="white"> </font>166 <font color="white"> </font>
168 </para>167 </para>
169 <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>168 <para style="terp_default_8">Tel. : [[ (o.contact_id and o.contact_id.phone or o.partner_id.phone) or removeParentNode('para') ]]</para>
170 <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>169 <para style="terp_default_8">Fax : [[ (o.contact_id and o.contact_id.fax or o.partner_id.fax) or removeParentNode('para') ]]</para>
171 <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>170 <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
172 </td>171 </td>
173 </tr>172 </tr>
174173
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py 2013-04-10 12:20:11 +0000
+++ analytic/analytic.py 2013-04-21 22:51:24 +0000
@@ -29,7 +29,7 @@
2929
30class account_analytic_account(osv.osv):30class account_analytic_account(osv.osv):
31 _name = 'account.analytic.account'31 _name = 'account.analytic.account'
32 _inherit = ['mail.thread']32 _inherit = ['mail.thread', 'res.contact.mixin']
33 _description = 'Analytic Account'33 _description = 'Analytic Account'
34 _track = {34 _track = {
35 'state': {35 'state': {
3636
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2013-04-17 09:09:25 +0000
+++ crm/crm_lead.py 2013-04-21 22:51:24 +0000
@@ -72,7 +72,7 @@
72 _name = "crm.lead"72 _name = "crm.lead"
73 _description = "Lead/Opportunity"73 _description = "Lead/Opportunity"
74 _order = "priority,date_action,id desc"74 _order = "priority,date_action,id desc"
75 _inherit = ['mail.thread', 'ir.needaction_mixin']75 _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
7676
77 _track = {77 _track = {
78 'state': {78 'state': {
@@ -240,7 +240,6 @@
240 _columns = {240 _columns = {
241 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',241 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
242 select=True, help="Linked partner (optional). Usually created when converting the lead."),242 select=True, help="Linked partner (optional). Usually created when converting the lead."),
243
244 'id': fields.integer('ID', readonly=True),243 'id': fields.integer('ID', readonly=True),
245 'name': fields.char('Subject', size=64, required=True, select=1),244 'name': fields.char('Subject', size=64, required=True, select=1),
246 'active': fields.boolean('Active', required=False),245 'active': fields.boolean('Active', required=False),
@@ -911,10 +910,11 @@
911 """910 """
912 opportunity = self.browse(cr, uid, ids[0], context)911 opportunity = self.browse(cr, uid, ids[0], context)
913 res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context)912 res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context)
913 default_partner_id = opportunity.contact_id and opportunity.contact_id.id or opportunity.partner_id and opportunity.partner_id.id or False
914 res['context'] = {914 res['context'] = {
915 'default_opportunity_id': opportunity.id,915 'default_opportunity_id': opportunity.id,
916 'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False,916 'default_partner_id': default_partner_id,
917 'default_partner_ids' : opportunity.partner_id and [opportunity.partner_id.id] or False,917 'default_partner_ids' : default_partner_id and [default_partner_id] or False,
918 'default_user_id': uid,918 'default_user_id': uid,
919 'default_section_id': opportunity.section_id and opportunity.section_id.id or False,919 'default_section_id': opportunity.section_id and opportunity.section_id.id or False,
920 'default_email_from': opportunity.email_from,920 'default_email_from': opportunity.email_from,
921921
=== modified file 'crm/wizard/crm_opportunity_to_phonecall.py'
--- crm/wizard/crm_opportunity_to_phonecall.py 2013-03-07 16:28:51 +0000
+++ crm/wizard/crm_opportunity_to_phonecall.py 2013-04-21 22:51:24 +0000
@@ -42,6 +42,7 @@
42 res = {}42 res = {}
43 res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})43 res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
44 for opp in opp_obj.browse(cr, uid, record_ids, context=context):44 for opp in opp_obj.browse(cr, uid, record_ids, context=context):
45 contact = opp.contact_id or opp.partner_id
45 if 'name' in fields:46 if 'name' in fields:
46 res.update({'name': opp.name})47 res.update({'name': opp.name})
47 if 'user_id' in fields:48 if 'user_id' in fields:
@@ -51,11 +52,11 @@
51 if 'categ_id' in fields:52 if 'categ_id' in fields:
52 res.update({'categ_id': categ_id})53 res.update({'categ_id': categ_id})
53 if 'partner_id' in fields:54 if 'partner_id' in fields:
54 res.update({'partner_id': opp.partner_id and opp.partner_id.id or False})55 res.update({'partner_id': contact and contact.id or False})
55 if 'contact_name' in fields:56 if 'contact_name' in fields:
56 res.update({'contact_name': opp.partner_id and opp.partner_id.name or False})57 res.update({'contact_name': contact and contact.name or False})
57 if 'phone' in fields:58 if 'phone' in fields:
58 res.update({'phone': opp.phone or (opp.partner_id and opp.partner_id.phone or False)})59 res.update({'phone': opp.phone or (contact and contact.phone or False)})
59 return res60 return res
6061
61 def action_schedule(self, cr, uid, ids, context=None):62 def action_schedule(self, cr, uid, ids, context=None):
6263
=== modified file 'crm_claim/crm_claim.py'
--- crm_claim/crm_claim.py 2013-01-15 13:43:59 +0000
+++ crm_claim/crm_claim.py 2013-04-21 22:51:24 +0000
@@ -72,7 +72,7 @@
72 _name = "crm.claim"72 _name = "crm.claim"
73 _description = "Claim"73 _description = "Claim"
74 _order = "priority,date desc"74 _order = "priority,date desc"
75 _inherit = ['mail.thread']75 _inherit = ['mail.thread', 'res.contact.mixin']
7676
77 _columns = {77 _columns = {
78 'id': fields.integer('ID', readonly=True),78 'id': fields.integer('ID', readonly=True),
7979
=== modified file 'portal_sale/portal_sale_data.xml'
--- portal_sale/portal_sale_data.xml 2012-12-21 16:48:08 +0000
+++ portal_sale/portal_sale_data.xml 2013-04-21 22:51:24 +0000
@@ -8,7 +8,7 @@
8 <field name="name">Sales Order - Send by Email (Portal)</field>8 <field name="name">Sales Order - Send by Email (Portal)</field>
9 <field name="email_from">${object.user_id.email or ''}</field>9 <field name="email_from">${object.user_id.email or ''}</field>
10 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>10 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
11 <field name="email_recipients">${object.partner_invoice_id.id}</field>11 <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_invoice_id.id}</field>
12 <field name="model_id" ref="sale.model_sale_order"/>12 <field name="model_id" ref="sale.model_sale_order"/>
13 <field name="auto_delete" eval="True"/>13 <field name="auto_delete" eval="True"/>
14 <field name="report_template" ref="sale.report_sale_order"/>14 <field name="report_template" ref="sale.report_sale_order"/>
@@ -97,7 +97,7 @@
97 <field name="name">Invoice - Send by Email (Portal)</field>97 <field name="name">Invoice - Send by Email (Portal)</field>
98 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>98 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
99 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>99 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
100 <field name="email_recipients">${object.partner_id.id}</field>100 <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
101 <field name="model_id" ref="account.model_account_invoice"/>101 <field name="model_id" ref="account.model_account_invoice"/>
102 <field name="auto_delete" eval="True"/>102 <field name="auto_delete" eval="True"/>
103 <field name="report_template" ref="account.account_invoices"/>103 <field name="report_template" ref="account.account_invoices"/>
104104
=== modified file 'project/project.py'
--- project/project.py 2013-04-12 14:37:19 +0000
+++ project/project.py 2013-04-21 22:51:24 +0000
@@ -77,7 +77,7 @@
77 _description = "Project"77 _description = "Project"
78 _inherits = {'account.analytic.account': "analytic_account_id",78 _inherits = {'account.analytic.account': "analytic_account_id",
79 "mail.alias": "alias_id"}79 "mail.alias": "alias_id"}
80 _inherit = ['mail.thread', 'ir.needaction_mixin']80 _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin.methods']
8181
82 def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):82 def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
83 if user == 1:83 if user == 1:
8484
=== modified file 'purchase/edi/purchase_order_action_data.xml'
--- purchase/edi/purchase_order_action_data.xml 2013-03-08 14:24:48 +0000
+++ purchase/edi/purchase_order_action_data.xml 2013-04-21 22:51:24 +0000
@@ -21,7 +21,7 @@
21 <field name="name">Purchase Order - Send by mail</field>21 <field name="name">Purchase Order - Send by mail</field>
22 <field name="email_from">${object.validator.email or ''}</field>22 <field name="email_from">${object.validator.email or ''}</field>
23 <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>23 <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
24 <field name="email_recipients">${object.partner_id.id}</field>24 <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_id.id}</field>
25 <field name="model_id" ref="purchase.model_purchase_order"/>25 <field name="model_id" ref="purchase.model_purchase_order"/>
26 <field name="auto_delete" eval="True"/>26 <field name="auto_delete" eval="True"/>
27 <field name="report_template" ref="report_purchase_quotation"/>27 <field name="report_template" ref="report_purchase_quotation"/>
2828
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2013-04-09 12:25:30 +0000
+++ purchase/purchase.py 2013-04-21 22:51:24 +0000
@@ -242,7 +242,7 @@
242 ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'),242 ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'),
243 ]243 ]
244 _name = "purchase.order"244 _name = "purchase.order"
245 _inherit = ['mail.thread', 'ir.needaction_mixin']245 _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
246 _description = "Purchase Order"246 _description = "Purchase Order"
247 _order = "name desc"247 _order = "name desc"
248248
@@ -542,6 +542,7 @@
542 'reference': order.partner_ref or order.name,542 'reference': order.partner_ref or order.name,
543 'account_id': pay_acc_id,543 'account_id': pay_acc_id,
544 'type': 'in_invoice',544 'type': 'in_invoice',
545 'contact_id': order.contact_id and order.contact_id.id,
545 'partner_id': order.partner_id.id,546 'partner_id': order.partner_id.id,
546 'currency_id': order.pricelist_id.currency_id.id,547 'currency_id': order.pricelist_id.currency_id.id,
547 'journal_id': len(journal_ids) and journal_ids[0] or False,548 'journal_id': len(journal_ids) and journal_ids[0] or False,
@@ -624,6 +625,7 @@
624 'origin': order.name + ((order.origin and (':' + order.origin)) or ''),625 'origin': order.name + ((order.origin and (':' + order.origin)) or ''),
625 'date': self.date_to_datetime(cr, uid, order.date_order, context),626 'date': self.date_to_datetime(cr, uid, order.date_order, context),
626 'partner_id': order.dest_address_id.id or order.partner_id.id,627 'partner_id': order.dest_address_id.id or order.partner_id.id,
628 'contact_id': order.contact_id and order.contact_id.id,
627 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',629 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
628 'type': 'in',630 'type': 'in',
629 'partner_id': order.dest_address_id.id or order.partner_id.id,631 'partner_id': order.dest_address_id.id or order.partner_id.id,
630632
=== modified file 'purchase/report/request_quotation.rml'
--- purchase/report/request_quotation.rml 2012-12-15 16:23:09 +0000
+++ purchase/report/request_quotation.rml 2013-04-21 22:51:24 +0000
@@ -101,7 +101,7 @@
101 </td>101 </td>
102 <td>102 <td>
103 <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>103 <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>
104 <para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para>104 <para style="terp_default_9">[[ display_address(order.contact_id or order.partner_id) ]] </para>
105 <para style="terp_default_9">105 <para style="terp_default_9">
106 <font color="white"> </font>106 <font color="white"> </font>
107 </para>107 </para>
108108
=== modified file 'purchase/report/request_quotation.sxw'
109Binary 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 differ109Binary 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
=== modified file 'sale/edi/sale_order_action_data.xml'
--- sale/edi/sale_order_action_data.xml 2012-12-21 16:48:08 +0000
+++ sale/edi/sale_order_action_data.xml 2013-04-21 22:51:24 +0000
@@ -22,7 +22,7 @@
22 <field name="name">Sales Order - Send by Email</field>22 <field name="name">Sales Order - Send by Email</field>
23 <field name="email_from">${object.user_id.email or ''}</field>23 <field name="email_from">${object.user_id.email or ''}</field>
24 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>24 <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
25 <field name="email_recipients">${object.partner_invoice_id.id}</field>25 <field name="email_recipients">${object.contact_id and object.contact_id.id or object.partner_invoice_id.id}</field>
26 <field name="model_id" ref="sale.model_sale_order"/>26 <field name="model_id" ref="sale.model_sale_order"/>
27 <field name="auto_delete" eval="True"/>27 <field name="auto_delete" eval="True"/>
28 <field name="report_template" ref="report_sale_order"/>28 <field name="report_template" ref="report_sale_order"/>
2929
=== modified file 'sale/report/sale_order.rml'
--- sale/report/sale_order.rml 2013-03-18 13:56:54 +0000
+++ sale/report/sale_order.rml 2013-04-21 22:51:24 +0000
@@ -178,8 +178,8 @@
178 </para>178 </para>
179 </td>179 </td>
180 <td>180 <td>
181 <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>181 <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>
182 <para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para>182 <para style="terp_default_9">[[ o.contact_id and display_address(o.contact_id) ]] </para>
183 <para style="terp_default_9">183 <para style="terp_default_9">
184 <font color="white"> </font>184 <font color="white"> </font>
185 </para>185 </para>
186186
=== modified file 'sale/report/sale_order.sxw'
187Binary 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 differ187Binary 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
=== modified file 'sale/sale.py'
--- sale/sale.py 2013-04-18 17:21:23 +0000
+++ sale/sale.py 2013-04-21 22:51:24 +0000
@@ -47,7 +47,7 @@
4747
48class sale_order(osv.osv):48class sale_order(osv.osv):
49 _name = "sale.order"49 _name = "sale.order"
50 _inherit = ['mail.thread', 'ir.needaction_mixin']50 _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin']
51 _description = "Sales Order"51 _description = "Sales Order"
52 _track = {52 _track = {
53 'state': {53 'state': {
@@ -368,7 +368,8 @@
368 'type': 'out_invoice',368 'type': 'out_invoice',
369 'reference': order.client_order_ref or order.name,369 'reference': order.client_order_ref or order.name,
370 'account_id': order.partner_id.property_account_receivable.id,370 'account_id': order.partner_id.property_account_receivable.id,
371 'partner_id': order.partner_invoice_id.id,371 'contact_id': order.partner_invoice_id.id,
372 'partner_id': order.partner_invoice_id.commercial_entity_id.id,
372 'journal_id': journal_ids[0],373 'journal_id': journal_ids[0],
373 'invoice_line': [(6, 0, lines)],374 'invoice_line': [(6, 0, lines)],
374 'currency_id': order.pricelist_id.currency_id.id,375 'currency_id': order.pricelist_id.currency_id.id,
375376
=== modified file 'sale_crm/wizard/crm_make_sale.py'
--- sale_crm/wizard/crm_make_sale.py 2012-12-21 16:48:08 +0000
+++ sale_crm/wizard/crm_make_sale.py 2013-04-21 22:51:24 +0000
@@ -46,8 +46,8 @@
46 if not active_id:46 if not active_id:
47 return False47 return False
4848
49 lead = lead_obj.read(cr, uid, active_id, ['partner_id'])49 lead = lead_obj.read(cr, uid, active_id, ['contact_id'])
50 return lead['partner_id']50 return lead['contact_id']
5151
52 def view_init(self, cr, uid, fields_list, context=None):52 def view_init(self, cr, uid, fields_list, context=None):
53 return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)53 return super(crm_make_sale, self).view_init(cr, uid, fields_list, context=context)
5454
=== modified file 'sale_stock/sale_stock.py'
--- sale_stock/sale_stock.py 2013-04-09 12:25:30 +0000
+++ sale_stock/sale_stock.py 2013-04-21 22:51:24 +0000
@@ -344,7 +344,8 @@
344 'state': 'auto',344 'state': 'auto',
345 'move_type': order.picking_policy,345 'move_type': order.picking_policy,
346 'sale_id': order.id,346 'sale_id': order.id,
347 'partner_id': order.partner_shipping_id.id,347 'contact_id': order.partner_shipping_id.id,
348 'partner_id': order.partner_shipping_id.commercial_entity_id.id,
348 'note': order.note,349 'note': order.note,
349 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none',350 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none',
350 'company_id': order.company_id.id,351 'company_id': order.company_id.id,
351352
=== modified file 'stock/report/picking.rml'
--- stock/report/picking.rml 2013-03-06 15:36:19 +0000
+++ stock/report/picking.rml 2013-04-21 22:51:24 +0000
@@ -168,9 +168,9 @@
168 </td>168 </td>
169 <td>169 <td>
170 <para style="terp_default_Bold_9">Contact Address :</para>170 <para style="terp_default_Bold_9">Contact Address :</para>
171 <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>171 <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>
172 <para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]] </para>172 <para style="terp_default_9">[[ picking.partner_id and display_address(picking.contact_id or picking.partner_id) ]] </para>
173 <para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>173 <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>
174 </td>174 </td>
175 </tr>175 </tr>
176 </blockTable>176 </blockTable>
177177
=== modified file 'stock/stock.py'
--- stock/stock.py 2013-04-05 15:30:21 +0000
+++ stock/stock.py 2013-04-21 22:51:24 +0000
@@ -545,7 +545,7 @@
545#----------------------------------------------------------545#----------------------------------------------------------
546class stock_picking(osv.osv):546class stock_picking(osv.osv):
547 _name = "stock.picking"547 _name = "stock.picking"
548 _inherit = ['mail.thread']548 _inherit = ['mail.thread', 'res.contact.mixin']
549 _description = "Picking List"549 _description = "Picking List"
550550
551 def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):551 def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):
@@ -1026,6 +1026,7 @@
1026 'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),1026 'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
1027 'type': inv_type,1027 'type': inv_type,
1028 'account_id': account_id,1028 'account_id': account_id,
1029 'contact': picking.contact_id and picking.contact_id.id,
1029 'partner_id': partner.id,1030 'partner_id': partner.id,
1030 'comment': comment,1031 'comment': comment,
1031 'payment_term': payment_term,1032 'payment_term': payment_term,