[MERGE] forward port of branch 7.0 up to e2dd18f
authorDenis Ledoux <dle@odoo.com>
Wed, 26 Nov 2014 11:35:36 +0000 (12:35 +0100)
committerDenis Ledoux <dle@odoo.com>
Wed, 26 Nov 2014 11:35:36 +0000 (12:35 +0100)
addons/account/account_invoice.py
addons/l10n_br/account_view.xml
addons/marketing_campaign/__openerp__.py
addons/mrp/mrp.py
addons/product/product.py
addons/product/product_view.xml
addons/project_timesheet/project_timesheet.py

index 70d644d..284dba8 100644 (file)
@@ -1829,10 +1829,10 @@ class res_partner(osv.osv):
         '''
         return partner.commercial_partner_id
 
-    def copy(self, cr, uid, id, default=None, context=None):
+    def copy_data(self, cr, uid, id, default=None, context=None):
         default = default or {}
         default.update({'invoice_ids' : []})
-        return super(res_partner, self).copy(cr, uid, id, default, context)
+        return super(res_partner, self).copy_data(cr, uid, id, default=default, context=context)
 
 
 class mail_compose_message(osv.Model):
index 4eaffd3..0dd246e 100644 (file)
                        <field name="inherit_id" ref="account.view_account_tax_template_form"/>
                        <field name="arch" type="xml">
                                <field position="after" name="price_include">
-                                       <field groups="base.group_extended" name="tax_discount"/>
+                                       <field name="tax_discount"/>
                            </field>
                        <field name="tax_code_id" position="replace" >
                                        <field name="tax_code_id" on_change="onchange_tax_code_id(tax_code_id)" />
                            </field>
-                               <field position="after" name="amount">
-                                       <field groups="base.group_extended" name="base_reduction"/>
-                                       <field groups="base.group_extended" name="amount_mva"/>
+                               <field position="after" name="tax_discount">
+                                       <field name="base_reduction"/>
+                                       <field name="amount_mva"/>
                            </field>
                        </field>
                </record>
                        <field name="inherit_id" ref="account.view_tax_form"/>
                        <field name="arch" type="xml">
                                <field position="after" name="price_include">
-                                       <field groups="base.group_extended" name="tax_discount"/>
+                                       <field name="tax_discount"/>
                            </field>
                                <field name="tax_code_id" position="replace" >
                                        <field name="tax_code_id" on_change="onchange_tax_code_id(tax_code_id)" />
                            </field>
-                           <field position="after" name="amount">
-                                       <field groups="base.group_extended" name="base_reduction"/>
-                                       <field groups="base.group_extended" name="amount_mva"/>
+                           <field position="after" name="tax_discount">
+                                       <field name="base_reduction"/>
+                                       <field name="amount_mva"/>
                            </field>
                        </field>
                </record>
index 0a37f8a..9728979 100644 (file)
@@ -40,7 +40,7 @@ The campaigns are dynamic and multi-channels. The process is as follows:
       send, reports to print and send by email, custom actions
     * Define input segments that will select the items that should enter the
       campaign (e.g leads from certain countries.)
-    * Run you campaign in simulation mode to test it real-time or accelerated,
+    * Run your campaign in simulation mode to test it real-time or accelerated,
       and fine-tune it
     * You may also start the real campaign in manual mode, where each action
       requires manual validation
index e9e099b..c5ede21 100644 (file)
@@ -330,7 +330,7 @@ class mrp_bom(osv.osv):
         if bom.type == 'phantom' and not bom.bom_lines:
             newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties)
 
-            if newbom:
+            if newbom and newbom != bom.id:
                 res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10)
                 result = result + res[0]
                 result2 = result2 + res[1]
index f645299..be92271 100644 (file)
@@ -152,6 +152,7 @@ class product_uom(osv.osv):
     _defaults = {
         'active': 1,
         'rounding': 0.01,
+        'factor': 1,
         'uom_type': 'reference',
     }
 
index 666622f..35efd04 100644 (file)
                                 <field name="factor"
                                     digits="[42,5]"
                                     attrs="{'invisible':[('uom_type','!=','smaller')],
-                                            'readonly':[('uom_type','!=','smaller')]}"/>
+                                            'readonly':[('uom_type','=','bigger')]}"/>
                                 <field name="factor_inv"
                                     digits="[42,5]"
                                     attrs="{'invisible':[('uom_type','!=','bigger')],
index 3c3b7fe..2b04a1a 100644 (file)
@@ -118,7 +118,9 @@ class project_work(osv.osv):
         vals_line['user_id'] = vals['user_id']
         vals_line['product_id'] = result['product_id']
         if vals.get('date'):
-            vals_line['date' ] = vals['date'][:10]
+            timestamp = datetime.datetime.strptime(vals['date'], tools.DEFAULT_SERVER_DATETIME_FORMAT)
+            ts = fields.datetime.context_timestamp(cr, uid, timestamp, context)
+            vals_line['date'] = ts.strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
 
         # Calculate quantity based on employee's product's uom
         vals_line['unit_amount'] = vals['hours']