Merge lp:~openerp-community/openobject-addons/contact-id-solution-for-v7-contact-management into lp:openobject-addons/7.0
- contact-id-solution-for-v7-contact-management
- Merge into 7.0
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Dony (Odoo) | Disapprove | ||
Review via email: mp+159320@code.launchpad.net |
Commit message
Description of the change
- 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
- 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
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 | 184 | return invoice_ids | 184 | return invoice_ids |
6 | 185 | 185 | ||
7 | 186 | _name = "account.invoice" | 186 | _name = "account.invoice" |
9 | 187 | _inherit = ['mail.thread'] | 187 | _inherit = ['mail.thread', 'res.contact.mixin'] |
10 | 188 | _description = 'Invoice' | 188 | _description = 'Invoice' |
11 | 189 | _order = "id desc" | 189 | _order = "id desc" |
12 | 190 | _track = { | 190 | _track = { |
13 | 191 | 191 | ||
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 | 622 | </record> | 622 | </record> |
19 | 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"/> |
20 | 624 | 624 | ||
22 | 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"/> |
23 | 626 | 626 | ||
24 | 627 | <act_window | 627 | <act_window |
25 | 628 | id="act_account_journal_2_account_invoice_opened" | 628 | id="act_account_journal_2_account_invoice_opened" |
26 | 629 | 629 | ||
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 | 24 | <field name="name">Invoice - Send by Email</field> | 24 | <field name="name">Invoice - Send by Email</field> |
32 | 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> |
33 | 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> |
35 | 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> |
36 | 28 | <field name="model_id" ref="account.model_account_invoice"/> | 28 | <field name="model_id" ref="account.model_account_invoice"/> |
37 | 29 | <field name="auto_delete" eval="True"/> | 29 | <field name="auto_delete" eval="True"/> |
38 | 30 | <field name="report_template" ref="account_invoices"/> | 30 | <field name="report_template" ref="account_invoices"/> |
39 | 31 | 31 | ||
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 | 26 | class account_invoice_report(osv.osv): | 26 | class account_invoice_report(osv.osv): |
45 | 27 | _name = "account.invoice.report" | 27 | _name = "account.invoice.report" |
46 | 28 | _description = "Invoices Statistics" | 28 | _description = "Invoices Statistics" |
47 | 29 | _inherit = ['res.contact.mixin'] | ||
48 | 29 | _auto = False | 30 | _auto = False |
49 | 30 | _rec_name = 'date' | 31 | _rec_name = 'date' |
50 | 31 | 32 | ||
51 | @@ -103,7 +104,7 @@ | |||
52 | 103 | 104 | ||
53 | 104 | def _select(self): | 105 | def _select(self): |
54 | 105 | select_str = """ | 106 | select_str = """ |
56 | 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, |
57 | 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, |
58 | 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, |
59 | 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, |
60 | @@ -119,7 +120,7 @@ | |||
61 | 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, |
62 | 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, |
63 | 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, |
65 | 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, |
66 | 123 | CASE | 124 | CASE |
67 | 124 | WHEN u.uom_type::text <> 'reference'::text | 125 | WHEN u.uom_type::text <> 'reference'::text |
68 | 125 | THEN ( SELECT product_uom.name | 126 | THEN ( SELECT product_uom.name |
69 | @@ -190,7 +191,7 @@ | |||
70 | 190 | to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text), | 191 | to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text), |
71 | 191 | to_char(ai.date_invoice::timestamp with time zone, 'MM'::text), | 192 | to_char(ai.date_invoice::timestamp with time zone, 'MM'::text), |
72 | 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), |
74 | 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, |
75 | 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, |
76 | 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, |
77 | 196 | ai.amount_total, u.uom_type, u.category_id | 197 | ai.amount_total, u.uom_type, u.category_id |
78 | 197 | 198 | ||
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 | 161 | </para> | 161 | </para> |
84 | 162 | </td> | 162 | </td> |
85 | 163 | <td> | 163 | <td> |
88 | 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> |
87 | 165 | <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para> | ||
89 | 166 | <para style="terp_default_8"> | 165 | <para style="terp_default_8"> |
90 | 167 | <font color="white"> </font> | 166 | <font color="white"> </font> |
91 | 168 | </para> | 167 | </para> |
94 | 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> |
95 | 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> |
96 | 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> |
97 | 172 | </td> | 171 | </td> |
98 | 173 | </tr> | 172 | </tr> |
99 | 174 | 173 | ||
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 | 29 | 29 | ||
105 | 30 | class account_analytic_account(osv.osv): | 30 | class account_analytic_account(osv.osv): |
106 | 31 | _name = 'account.analytic.account' | 31 | _name = 'account.analytic.account' |
108 | 32 | _inherit = ['mail.thread'] | 32 | _inherit = ['mail.thread', 'res.contact.mixin'] |
109 | 33 | _description = 'Analytic Account' | 33 | _description = 'Analytic Account' |
110 | 34 | _track = { | 34 | _track = { |
111 | 35 | 'state': { | 35 | 'state': { |
112 | 36 | 36 | ||
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 | 72 | _name = "crm.lead" | 72 | _name = "crm.lead" |
118 | 73 | _description = "Lead/Opportunity" | 73 | _description = "Lead/Opportunity" |
119 | 74 | _order = "priority,date_action,id desc" | 74 | _order = "priority,date_action,id desc" |
121 | 75 | _inherit = ['mail.thread', 'ir.needaction_mixin'] | 75 | _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin'] |
122 | 76 | 76 | ||
123 | 77 | _track = { | 77 | _track = { |
124 | 78 | 'state': { | 78 | 'state': { |
125 | @@ -240,7 +240,6 @@ | |||
126 | 240 | _columns = { | 240 | _columns = { |
127 | 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', |
128 | 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."), |
129 | 243 | |||
130 | 244 | 'id': fields.integer('ID', readonly=True), | 243 | 'id': fields.integer('ID', readonly=True), |
131 | 245 | 'name': fields.char('Subject', size=64, required=True, select=1), | 244 | 'name': fields.char('Subject', size=64, required=True, select=1), |
132 | 246 | 'active': fields.boolean('Active', required=False), | 245 | 'active': fields.boolean('Active', required=False), |
133 | @@ -911,10 +910,11 @@ | |||
134 | 911 | """ | 910 | """ |
135 | 912 | opportunity = self.browse(cr, uid, ids[0], context) | 911 | opportunity = self.browse(cr, uid, ids[0], context) |
136 | 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) |
137 | 913 | default_partner_id = opportunity.contact_id and opportunity.contact_id.id or opportunity.partner_id and opportunity.partner_id.id or False | ||
138 | 914 | res['context'] = { | 914 | res['context'] = { |
139 | 915 | 'default_opportunity_id': opportunity.id, | 915 | 'default_opportunity_id': opportunity.id, |
142 | 916 | 'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False, | 916 | 'default_partner_id': default_partner_id, |
143 | 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, |
144 | 918 | 'default_user_id': uid, | 918 | 'default_user_id': uid, |
145 | 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, |
146 | 920 | 'default_email_from': opportunity.email_from, | 920 | 'default_email_from': opportunity.email_from, |
147 | 921 | 921 | ||
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 | 42 | res = {} | 42 | res = {} |
153 | 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')}) |
154 | 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): |
155 | 45 | contact = opp.contact_id or opp.partner_id | ||
156 | 45 | if 'name' in fields: | 46 | if 'name' in fields: |
157 | 46 | res.update({'name': opp.name}) | 47 | res.update({'name': opp.name}) |
158 | 47 | if 'user_id' in fields: | 48 | if 'user_id' in fields: |
159 | @@ -51,11 +52,11 @@ | |||
160 | 51 | if 'categ_id' in fields: | 52 | if 'categ_id' in fields: |
161 | 52 | res.update({'categ_id': categ_id}) | 53 | res.update({'categ_id': categ_id}) |
162 | 53 | if 'partner_id' in fields: | 54 | if 'partner_id' in fields: |
164 | 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}) |
165 | 55 | if 'contact_name' in fields: | 56 | if 'contact_name' in fields: |
167 | 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}) |
168 | 57 | if 'phone' in fields: | 58 | if 'phone' in fields: |
170 | 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)}) |
171 | 59 | return res | 60 | return res |
172 | 60 | 61 | ||
173 | 61 | def action_schedule(self, cr, uid, ids, context=None): | 62 | def action_schedule(self, cr, uid, ids, context=None): |
174 | 62 | 63 | ||
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 | 72 | _name = "crm.claim" | 72 | _name = "crm.claim" |
180 | 73 | _description = "Claim" | 73 | _description = "Claim" |
181 | 74 | _order = "priority,date desc" | 74 | _order = "priority,date desc" |
183 | 75 | _inherit = ['mail.thread'] | 75 | _inherit = ['mail.thread', 'res.contact.mixin'] |
184 | 76 | 76 | ||
185 | 77 | _columns = { | 77 | _columns = { |
186 | 78 | 'id': fields.integer('ID', readonly=True), | 78 | 'id': fields.integer('ID', readonly=True), |
187 | 79 | 79 | ||
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 | 8 | <field name="name">Sales Order - Send by Email (Portal)</field> | 8 | <field name="name">Sales Order - Send by Email (Portal)</field> |
193 | 9 | <field name="email_from">${object.user_id.email or ''}</field> | 9 | <field name="email_from">${object.user_id.email or ''}</field> |
194 | 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> |
196 | 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> |
197 | 12 | <field name="model_id" ref="sale.model_sale_order"/> | 12 | <field name="model_id" ref="sale.model_sale_order"/> |
198 | 13 | <field name="auto_delete" eval="True"/> | 13 | <field name="auto_delete" eval="True"/> |
199 | 14 | <field name="report_template" ref="sale.report_sale_order"/> | 14 | <field name="report_template" ref="sale.report_sale_order"/> |
200 | @@ -97,7 +97,7 @@ | |||
201 | 97 | <field name="name">Invoice - Send by Email (Portal)</field> | 97 | <field name="name">Invoice - Send by Email (Portal)</field> |
202 | 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> |
203 | 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> |
205 | 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> |
206 | 101 | <field name="model_id" ref="account.model_account_invoice"/> | 101 | <field name="model_id" ref="account.model_account_invoice"/> |
207 | 102 | <field name="auto_delete" eval="True"/> | 102 | <field name="auto_delete" eval="True"/> |
208 | 103 | <field name="report_template" ref="account.account_invoices"/> | 103 | <field name="report_template" ref="account.account_invoices"/> |
209 | 104 | 104 | ||
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 | 77 | _description = "Project" | 77 | _description = "Project" |
215 | 78 | _inherits = {'account.analytic.account': "analytic_account_id", | 78 | _inherits = {'account.analytic.account': "analytic_account_id", |
216 | 79 | "mail.alias": "alias_id"} | 79 | "mail.alias": "alias_id"} |
218 | 80 | _inherit = ['mail.thread', 'ir.needaction_mixin'] | 80 | _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin.methods'] |
219 | 81 | 81 | ||
220 | 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): |
221 | 83 | if user == 1: | 83 | if user == 1: |
222 | 84 | 84 | ||
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 | 21 | <field name="name">Purchase Order - Send by mail</field> | 21 | <field name="name">Purchase Order - Send by mail</field> |
228 | 22 | <field name="email_from">${object.validator.email or ''}</field> | 22 | <field name="email_from">${object.validator.email or ''}</field> |
229 | 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> |
231 | 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> |
232 | 25 | <field name="model_id" ref="purchase.model_purchase_order"/> | 25 | <field name="model_id" ref="purchase.model_purchase_order"/> |
233 | 26 | <field name="auto_delete" eval="True"/> | 26 | <field name="auto_delete" eval="True"/> |
234 | 27 | <field name="report_template" ref="report_purchase_quotation"/> | 27 | <field name="report_template" ref="report_purchase_quotation"/> |
235 | 28 | 28 | ||
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 | 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!'), |
241 | 243 | ] | 243 | ] |
242 | 244 | _name = "purchase.order" | 244 | _name = "purchase.order" |
244 | 245 | _inherit = ['mail.thread', 'ir.needaction_mixin'] | 245 | _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin'] |
245 | 246 | _description = "Purchase Order" | 246 | _description = "Purchase Order" |
246 | 247 | _order = "name desc" | 247 | _order = "name desc" |
247 | 248 | 248 | ||
248 | @@ -542,6 +542,7 @@ | |||
249 | 542 | 'reference': order.partner_ref or order.name, | 542 | 'reference': order.partner_ref or order.name, |
250 | 543 | 'account_id': pay_acc_id, | 543 | 'account_id': pay_acc_id, |
251 | 544 | 'type': 'in_invoice', | 544 | 'type': 'in_invoice', |
252 | 545 | 'contact_id': order.contact_id and order.contact_id.id, | ||
253 | 545 | 'partner_id': order.partner_id.id, | 546 | 'partner_id': order.partner_id.id, |
254 | 546 | 'currency_id': order.pricelist_id.currency_id.id, | 547 | 'currency_id': order.pricelist_id.currency_id.id, |
255 | 547 | 'journal_id': len(journal_ids) and journal_ids[0] or False, | 548 | 'journal_id': len(journal_ids) and journal_ids[0] or False, |
256 | @@ -624,6 +625,7 @@ | |||
257 | 624 | 'origin': order.name + ((order.origin and (':' + order.origin)) or ''), | 625 | 'origin': order.name + ((order.origin and (':' + order.origin)) or ''), |
258 | 625 | 'date': self.date_to_datetime(cr, uid, order.date_order, context), | 626 | 'date': self.date_to_datetime(cr, uid, order.date_order, context), |
259 | 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, |
260 | 628 | 'contact_id': order.contact_id and order.contact_id.id, | ||
261 | 627 | 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none', | 629 | 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none', |
262 | 628 | 'type': 'in', | 630 | 'type': 'in', |
263 | 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, |
264 | 630 | 632 | ||
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 | 101 | </td> | 101 | </td> |
270 | 102 | <td> | 102 | <td> |
271 | 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> |
273 | 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> |
274 | 105 | <para style="terp_default_9"> | 105 | <para style="terp_default_9"> |
275 | 106 | <font color="white"> </font> | 106 | <font color="white"> </font> |
276 | 107 | </para> | 107 | </para> |
277 | 108 | 108 | ||
278 | === modified file 'purchase/report/request_quotation.sxw' | |||
279 | 109 | Binary 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 | 109 | Binary 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 | 22 | <field name="name">Sales Order - Send by Email</field> | 22 | <field name="name">Sales Order - Send by Email</field> |
285 | 23 | <field name="email_from">${object.user_id.email or ''}</field> | 23 | <field name="email_from">${object.user_id.email or ''}</field> |
286 | 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> |
288 | 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> |
289 | 26 | <field name="model_id" ref="sale.model_sale_order"/> | 26 | <field name="model_id" ref="sale.model_sale_order"/> |
290 | 27 | <field name="auto_delete" eval="True"/> | 27 | <field name="auto_delete" eval="True"/> |
291 | 28 | <field name="report_template" ref="report_sale_order"/> | 28 | <field name="report_template" ref="report_sale_order"/> |
292 | 29 | 29 | ||
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 | 178 | </para> | 178 | </para> |
298 | 179 | </td> | 179 | </td> |
299 | 180 | <td> | 180 | <td> |
302 | 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> |
303 | 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> |
304 | 183 | <para style="terp_default_9"> | 183 | <para style="terp_default_9"> |
305 | 184 | <font color="white"> </font> | 184 | <font color="white"> </font> |
306 | 185 | </para> | 185 | </para> |
307 | 186 | 186 | ||
308 | === modified file 'sale/report/sale_order.sxw' | |||
309 | 187 | Binary 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 | 187 | Binary 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 | 47 | 47 | ||
315 | 48 | class sale_order(osv.osv): | 48 | class sale_order(osv.osv): |
316 | 49 | _name = "sale.order" | 49 | _name = "sale.order" |
318 | 50 | _inherit = ['mail.thread', 'ir.needaction_mixin'] | 50 | _inherit = ['mail.thread', 'ir.needaction_mixin', 'res.contact.mixin'] |
319 | 51 | _description = "Sales Order" | 51 | _description = "Sales Order" |
320 | 52 | _track = { | 52 | _track = { |
321 | 53 | 'state': { | 53 | 'state': { |
322 | @@ -368,7 +368,8 @@ | |||
323 | 368 | 'type': 'out_invoice', | 368 | 'type': 'out_invoice', |
324 | 369 | 'reference': order.client_order_ref or order.name, | 369 | 'reference': order.client_order_ref or order.name, |
325 | 370 | 'account_id': order.partner_id.property_account_receivable.id, | 370 | 'account_id': order.partner_id.property_account_receivable.id, |
327 | 371 | 'partner_id': order.partner_invoice_id.id, | 371 | 'contact_id': order.partner_invoice_id.id, |
328 | 372 | 'partner_id': order.partner_invoice_id.commercial_entity_id.id, | ||
329 | 372 | 'journal_id': journal_ids[0], | 373 | 'journal_id': journal_ids[0], |
330 | 373 | 'invoice_line': [(6, 0, lines)], | 374 | 'invoice_line': [(6, 0, lines)], |
331 | 374 | 'currency_id': order.pricelist_id.currency_id.id, | 375 | 'currency_id': order.pricelist_id.currency_id.id, |
332 | 375 | 376 | ||
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 | 46 | if not active_id: | 46 | if not active_id: |
338 | 47 | return False | 47 | return False |
339 | 48 | 48 | ||
342 | 49 | lead = lead_obj.read(cr, uid, active_id, ['partner_id']) | 49 | lead = lead_obj.read(cr, uid, active_id, ['contact_id']) |
343 | 50 | return lead['partner_id'] | 50 | return lead['contact_id'] |
344 | 51 | 51 | ||
345 | 52 | def view_init(self, cr, uid, fields_list, context=None): | 52 | def view_init(self, cr, uid, fields_list, context=None): |
346 | 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) |
347 | 54 | 54 | ||
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 | 344 | 'state': 'auto', | 344 | 'state': 'auto', |
353 | 345 | 'move_type': order.picking_policy, | 345 | 'move_type': order.picking_policy, |
354 | 346 | 'sale_id': order.id, | 346 | 'sale_id': order.id, |
356 | 347 | 'partner_id': order.partner_shipping_id.id, | 347 | 'contact_id': order.partner_shipping_id.id, |
357 | 348 | 'partner_id': order.partner_shipping_id.commercial_entity_id.id, | ||
358 | 348 | 'note': order.note, | 349 | 'note': order.note, |
359 | 349 | 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', | 350 | 'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none', |
360 | 350 | 'company_id': order.company_id.id, | 351 | 'company_id': order.company_id.id, |
361 | 351 | 352 | ||
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 | 168 | </td> | 168 | </td> |
367 | 169 | <td> | 169 | <td> |
368 | 170 | <para style="terp_default_Bold_9">Contact Address :</para> | 170 | <para style="terp_default_Bold_9">Contact Address :</para> |
372 | 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> |
373 | 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> |
374 | 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> |
375 | 174 | </td> | 174 | </td> |
376 | 175 | </tr> | 175 | </tr> |
377 | 176 | </blockTable> | 176 | </blockTable> |
378 | 177 | 177 | ||
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 | 545 | #---------------------------------------------------------- | 545 | #---------------------------------------------------------- |
384 | 546 | class stock_picking(osv.osv): | 546 | class stock_picking(osv.osv): |
385 | 547 | _name = "stock.picking" | 547 | _name = "stock.picking" |
387 | 548 | _inherit = ['mail.thread'] | 548 | _inherit = ['mail.thread', 'res.contact.mixin'] |
388 | 549 | _description = "Picking List" | 549 | _description = "Picking List" |
389 | 550 | 550 | ||
390 | 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): |
391 | @@ -1026,6 +1026,7 @@ | |||
392 | 1026 | 'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''), | 1026 | 'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''), |
393 | 1027 | 'type': inv_type, | 1027 | 'type': inv_type, |
394 | 1028 | 'account_id': account_id, | 1028 | 'account_id': account_id, |
395 | 1029 | 'contact': picking.contact_id and picking.contact_id.id, | ||
396 | 1029 | 'partner_id': partner.id, | 1030 | 'partner_id': partner.id, |
397 | 1030 | 'comment': comment, | 1031 | 'comment': comment, |
398 | 1031 | 'payment_term': payment_term, | 1032 | 'payment_term': payment_term, |
Please see my comment on the server merge proposal this branch depends on: /code.launchpad .net/~openerp- community/ openobject- server/ contact- id-solution- for-v7- contact- management/ +merge/ 159316
https:/
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'?