[MERGE] forward port of branch 7.0 up to 095be21
authorDenis Ledoux <dle@odoo.com>
Wed, 6 Aug 2014 11:06:20 +0000 (13:06 +0200)
committerDenis Ledoux <dle@odoo.com>
Wed, 6 Aug 2014 11:06:20 +0000 (13:06 +0200)
1  2 
addons/account/edi/invoice_action_data.xml
addons/analytic/analytic.py
addons/point_of_sale/point_of_sale_view.xml
addons/portal_claim/portal_claim.py
addons/portal_sale/portal_sale_data.xml
addons/purchase/edi/purchase_order_action_data.xml
addons/sale/edi/sale_order_action_data.xml
addons/stock/stock.py

@@@ -23,8 -23,8 +23,8 @@@
          <record id="email_template_edi_invoice" model="email.template">
              <field name="name">Invoice - Send by Email</field>
              <field name="email_from">${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}</field>
-             <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
+             <field name="subject">${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a'})</field>
 -            <field name="email_recipients">${object.partner_id.id}</field>
 +            <field name="partner_to">${object.partner_id.id}</field>
              <field name="model_id" ref="account.model_account_invoice"/>
              <field name="auto_delete" eval="True"/>
              <field name="report_template" ref="account_invoices"/>
Simple merge
index 0000000,d7c9c1a..0a3aa40
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,39 +1,44 @@@
+ # -*- coding: utf-8 -*-
+ ##############################################################################
+ #
+ #    OpenERP, Open Source Management Solution
+ #    Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
+ #
+ #    This program is free software: you can redistribute it and/or modify
+ #    it under the terms of the GNU Affero General Public License as
+ #    published by the Free Software Foundation, either version 3 of the
+ #    License, or (at your option) any later version.
+ #
+ #    This program is distributed in the hope that it will be useful,
+ #    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #    GNU Affero General Public License for more details.
+ #
+ #    You should have received a copy of the GNU Affero General Public License
+ #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
+ ##############################################################################
+ from openerp import SUPERUSER_ID
 -from openerp.addons.base_status.base_stage import base_stage
+ from openerp.osv import osv
 -class crm_claim(base_stage, osv.osv):
++class crm_claim(osv.osv):
+     _inherit = "crm.claim"
 -    def default_get(self, cr, uid, fields, context=None):
 -        res = super(crm_claim, self).default_get(cr, uid, fields, context=context)
 -        if isinstance(res.get('partner_id'), (int, long)):
++    def _get_default_partner_id(self, cr, uid, context=None):
++        """ Gives default partner_id """
++        if context is None:
++            context = {}
++        if context.get('portal'):
++            user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+             # Special case for portal users, as they are not allowed to call name_get on res.partner
+             # We save this call for the web client by returning it in default get
 -            res['partner_id'] = self.pool['res.partner'].name_get(
 -                cr, SUPERUSER_ID, [res['partner_id']], context=context)[0]
 -        return res
++            return self.pool['res.partner'].name_get(cr, SUPERUSER_ID, [user.partner_id.id], context=context)[0]
++        return False
++
++    _defaults = {
++        'partner_id': lambda s, cr, uid, c: s._get_default_partner_id(cr, uid, c),
++    }
+ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@@ -7,8 -7,8 +7,8 @@@
          <record id="email_template_edi_sale" model="email.template">
              <field name="name">Sales Order - Send by Email (Portal)</field>
              <field name="email_from">${(object.user_id.email or '')|safe}</field>
-             <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
+             <field name="subject">${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
 -            <field name="email_recipients">${object.partner_invoice_id.id}</field>
 +            <field name="partner_to">${object.partner_invoice_id.id}</field>
              <field name="model_id" ref="sale.model_sale_order"/>
              <field name="auto_delete" eval="True"/>
              <field name="report_template" ref="sale.report_sale_order"/>
          <record id="email_template_edi_invoice" model="email.template">
              <field name="name">Invoice - Send by Email (Portal)</field>
              <field name="email_from">${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}</field>
++<<<<<<< HEAD
 +            <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
 +            <field name="partner_to">${object.partner_id.id}</field>
++=======
+             <field name="subject">${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a' })</field>
+             <field name="email_recipients">${object.partner_id.id}</field>
++>>>>>>> 7.0
              <field name="model_id" ref="account.model_account_invoice"/>
              <field name="auto_delete" eval="True"/>
              <field name="report_template" ref="account.account_invoices"/>
@@@ -20,8 -20,8 +20,8 @@@
          <record id="email_template_edi_purchase" model="email.template">
              <field name="name">Purchase Order - Send by mail</field>
              <field name="email_from">${(object.validator.email or '')|safe}</field>
-             <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
+             <field name="subject">${object.company_id.name|safe} Order (Ref ${object.name or 'n/a' })</field>
 -            <field name="email_recipients">${object.partner_id.id}</field>
 +            <field name="partner_to">${object.partner_id.id}</field>
              <field name="model_id" ref="purchase.model_purchase_order"/>
              <field name="auto_delete" eval="True"/>
              <field name="report_template" ref="report_purchase_quotation"/>
@@@ -21,8 -21,8 +21,8 @@@
          <record id="email_template_edi_sale" model="email.template">
              <field name="name">Sales Order - Send by Email</field>
              <field name="email_from">${(object.user_id.email or '')|safe}</field>
-             <field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
+             <field name="subject">${object.company_id.name|safe} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
 -            <field name="email_recipients">${object.partner_invoice_id.id}</field>
 +            <field name="partner_to">${object.partner_invoice_id.id}</field>
              <field name="model_id" ref="sale.model_sale_order"/>
              <field name="auto_delete" eval="True"/>
              <field name="report_template" ref="report_sale_order"/>
Simple merge