[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9789 revid:dle@openerp.com...
authorDenis Ledoux <dle@openerp.com>
Fri, 24 Jan 2014 12:10:27 +0000 (13:10 +0100)
committerDenis Ledoux <dle@openerp.com>
Fri, 24 Jan 2014 12:10:27 +0000 (13:10 +0100)
bzr revid: dle@openerp.com-20140120174449-tui0a24zgn9bien2
bzr revid: dle@openerp.com-20140121125538-ke7i6kaz486hwgl8
bzr revid: dle@openerp.com-20140122134115-0ogjemlqe327xoac
bzr revid: dle@openerp.com-20140123103655-mf2zslfbgue97ed2
bzr revid: dle@openerp.com-20140124121027-uk9zy4dx9tqlsblr

14 files changed:
1  2 
addons/account_asset/account_asset.py
addons/document_ftp/ftpserver/abstracted_fs.py
addons/email_template/email_template.py
addons/mrp/mrp.py
addons/mrp/mrp_view.xml
addons/mrp_operations/mrp_operations_view.xml
addons/plugin/plugin_handler.py
addons/project_long_term/wizard/project_compute_phases.py
addons/purchase/purchase.py
addons/purchase/purchase_view.xml
addons/sale/sale_view.xml
addons/sale_stock/sale_stock_view.xml
addons/stock/product.py
addons/stock/stock.py

Simple merge
@@@ -410,17 -376,17 +410,17 @@@ class email_template(osv.osv)
  
          # create a mail_mail based on values, without attachments
          values = self.generate_email(cr, uid, template_id, res_id, context=context)
-         assert values.get('email_from'), 'email_from is missing or empty after template rendering, send_mail() cannot proceed'
+         if not values.get('email_from'):
+             raise osv.except_osv(_('Warning!'),_("Sender email is missing or empty after template rendering. Specify one to deliver your message"))
 -        # process email_recipients field that is a comma separated list of partner_ids -> recipient_ids
 +        # process partner_to field that is a comma separated list of partner_ids -> recipient_ids
          # NOTE: only usable if force_send is True, because otherwise the value is
          # not stored on the mail_mail, and therefore lost -> fixed in v8
 -        recipient_ids = []
 -        email_recipients = values.pop('email_recipients', '')
 -        if email_recipients:
 -            for partner_id in email_recipients.split(','):
 -                if partner_id:  # placeholders could generate '', 3, 2 due to some empty field values
 -                    recipient_ids.append(int(partner_id))
 +        values['recipient_ids'] = []
 +        partner_to = values.pop('partner_to', '')
 +        if partner_to:
 +            # placeholders could generate '', 3, 2 due to some empty field values
 +            tpl_partner_ids = [pid for pid in partner_to.split(',') if pid]
 +            values['recipient_ids'] += [(4, pid) for pid in self.pool['res.partner'].exists(cr, SUPERUSER_ID, tpl_partner_ids, context=context)]
  
          attachment_ids = values.pop('attachment_ids', [])
          attachments = values.pop('attachments', [])
Simple merge
Simple merge
@@@ -92,9 -92,10 +92,10 @@@ class plugin_handler(osv.osv_memory)
              @return Dictionary which contain model , url and resource id.
          """
          mail_message = self.pool.get('mail.message')
 -        model_obj = self.pool.get(model)
 +        model_obj = self.pool[model]
-         msg = self.pool.get('mail.thread').message_parse(cr, uid, email)
-         message_id = msg.get('message-id')
+         mail_thread_obj = self.pool.get('mail.thread')
+         msg = mail_thread_obj.message_parse(cr, uid, email)
+         message_id = msg.get('message_id')
          mail_ids = mail_message.search(cr, uid, [('message_id', '=', message_id), ('res_id', '=', res_id), ('model', '=', model)])
          if message_id and mail_ids:
              mail_record = mail_message.browse(cr, uid, mail_ids)[0]
Simple merge
Simple merge
                                      <group>
                                          <group>
                                              <field name="product_id"
 -                                                context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
 +                                                context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                                                  groups="base.group_user"
-                                                 on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
+                                                 on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
                                              <label for="product_uom_qty"/>
                                              <div>
                                                  <field
                                      <field name="state" invisible="1"/>
                                      <field name="th_weight" invisible="1"/>
                                      <field name="product_id"
 -                                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
 +                                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                                          groups="base.group_user" 
-                                         on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
+                                         on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
                                      <field name="name"/>
                                      <field name="product_uom_qty"
 -                                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
 +                                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                                          on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"/>
                                      <field name="product_uom"
                                          on_change="product_uom_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, context)"
                      <field name="state" position="replace">
                          <field name="state" widget="statusbar" statusbar_visible="draft,sent,progress,invoiced,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
                      </field>
 -                   <field name="shop_id" position="replace">
 -                        <field name="shop_id" on_change="onchange_shop_id(shop_id)" widget="selection" groups="stock.group_locations"/>
 -                   </field>
 +                    <field name="company_id" position="replace">
 +                        <field name="company_id" readonly="True"/>
 +                    </field>
 +                    <field name="fiscal_position" position="after">
 +                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
 +                    </field>
                     <field name="product_id" position="replace">
                         <field name="product_id"
 -                       context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
 +                       context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                         groups="base.group_user" 
-                        on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)"/>
+                        on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)"/>
                     </field>
                     <field name="product_uom_qty" position="replace">
 -                       <field context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
 +                       <field context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                               name="product_uom_qty" class="oe_inline"
                             on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
                     </field>
Simple merge
Simple merge