[MERGE] forward port of branch 7.0 up to 78a29b3
authorChristophe Simonis <chs@odoo.com>
Tue, 21 Oct 2014 11:06:27 +0000 (13:06 +0200)
committerChristophe Simonis <chs@odoo.com>
Tue, 21 Oct 2014 11:06:27 +0000 (13:06 +0200)
1  2 
addons/account_followup/account_followup.py
addons/mail/mail_thread.py
addons/point_of_sale/report/pos_order_report.py
addons/sale/wizard/sale_make_invoice_advance.py
openerp/addons/base/res/res_partner.py

Simple merge
@@@ -56,8 -61,11 +56,8 @@@ class pos_order_report(osv.osv)
                      sum(l.qty * u.factor) as product_qty,
                      sum(l.qty * l.price_unit) as price_total,
                      sum((l.qty * l.price_unit) * (l.discount / 100)) as total_discount,
-                     (sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal(16,2) as average_price,
+                     (sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal as average_price,
                      sum(cast(to_char(date_trunc('day',s.date_order) - date_trunc('day',s.create_date),'DD') as int)) as delay_validation,
 -                    to_char(s.date_order, 'YYYY') as year,
 -                    to_char(s.date_order, 'MM') as month,
 -                    to_char(s.date_order, 'YYYY-MM-DD') as day,
                      s.partner_id as partner_id,
                      s.state as state,
                      s.user_id as user_id,
@@@ -233,7 -218,8 +233,8 @@@ class res_partner(osv.osv, format_addre
          'date': fields.date('Date', select=1),
          'title': fields.many2one('res.partner.title', 'Title'),
          'parent_id': fields.many2one('res.partner', 'Related Company', select=True),
+         'parent_name': fields.related('parent_id', 'name', type='char', readonly=True, string='Parent name'),
 -        'child_ids': fields.one2many('res.partner', 'parent_id', 'Contacts', domain=[('active','=',True)]), # force "active_test" domain to bypass _search() override    
 +        'child_ids': fields.one2many('res.partner', 'parent_id', 'Contacts', domain=[('active','=',True)]), # force "active_test" domain to bypass _search() override
          'ref': fields.char('Reference', size=64, select=1),
          'lang': fields.selection(_lang_get, 'Language',
              help="If the selected language is loaded in the system, all documents related to this contact will be printed in this language. If not, it will be English."),
          for record in self.browse(cr, uid, ids, context=context):
              name = record.name
              if record.parent_id and not record.is_company:
-                 name =  "%s, %s" % (record.parent_id.name, name)
+                 name = "%s, %s" % (record.parent_name, name)
 +            if context.get('show_address_only'):
 +                name = self._display_address(cr, uid, record, without_company=True, context=context)
              if context.get('show_address'):
                  name = name + "\n" + self._display_address(cr, uid, record, without_company=True, context=context)
 -                name = name.replace('\n\n','\n')
 -                name = name.replace('\n\n','\n')
 +            name = name.replace('\n\n','\n')
 +            name = name.replace('\n\n','\n')
              if context.get('show_email') and record.email:
                  name = "%s <%s>" % (name, record.email)
              res.append((record.id, name))