diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index f7e561c8e2486296dd011f0778ac6ae8e05a669a..35979cd808ef412dea145738880fbd7764ddd916 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -409,9 +409,7 @@ class account_invoice(osv.osv):
         '''
         assert len(ids) == 1, 'This option should only be used for a single id at a time.'
         self.write(cr, uid, ids, {'sent': True}, context=context)
-        context2 = context.copy()
-        context2['active_ids'] = ids
-        return self.pool['report'].get_action(cr, uid, [], 'account.report_invoice', context=context2)
+        return self.pool['report'].get_action(cr, uid, ids, 'account.report_invoice', context=context)
 
     def action_invoice_sent(self, cr, uid, ids, context=None):
         '''
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 640ac90249b753f2eb7df4c08fb1f9087ea6d336..be41b06e346db9d24450f12ce53fb11c9fd8cad2 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1026,7 +1026,7 @@ class account_move_line(osv.osv):
             if opening_reconciliation:
                 obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
             obj_move_rec.unlink(cr, uid, unlink_ids)
-            if all_moves:
+            if len(all_moves) >= 2:
                 obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)
         return True
 
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 6a58bc7f77ec9cba9e0ed5a9c8cc0932121f5fb2..739fcf18d9f58a27eaede38b86410820222d3513 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -65,7 +65,8 @@
             <field name="arch" type="xml">
                 <xpath expr="//div[@name='buttons']" position="inside">
                     <button type="action" string="Invoices" 
-                        name="%(account.action_invoice_tree)d" 
+                        name="%(account.action_invoice_tree1)d" 
+                        attrs="{'invisible': [('customer', '=', False)]}" 
                         context="{'search_default_partner_id': active_id,'default_partner_id': active_id}" groups="account.group_account_invoice"/>
                     <button type="action" string="Journal Items" name="%(account.action_account_moves_all_tree)d" groups="account.group_account_user"/>
                     <button type="action" string="Contracts" name="%(account.action_open_partner_analytic_accounts)d"
diff --git a/addons/account/project/wizard/account_analytic_balance_report.py b/addons/account/project/wizard/account_analytic_balance_report.py
index 3a3c301cffcaa885d6e336a5943575e29b22b6ce..062945fa53ecf1b6778f085879a88f2ea019597f 100644
--- a/addons/account/project/wizard/account_analytic_balance_report.py
+++ b/addons/account/project/wizard/account_analytic_balance_report.py
@@ -50,6 +50,6 @@ class account_analytic_balance(osv.osv_memory):
 
         datas['form']['active_ids'] = context.get('active_ids', False)
 
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticbalance', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticbalance', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
index 125dfda46fbe878aef6d5e61002ed9c7ffaa64ec..ab84af4880a3570d10af903551ed148fca3cae93 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
@@ -49,6 +49,6 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory):
         }
 
         datas['form']['active_ids'] = context.get('active_ids', False)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledgerquantity', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticcostledgerquantity', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
index 5f00c3c9ac5265587c75401d84e5c2bc34922932..978863f5900c442b1179f4d38e65d48cd9f2db83 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_report.py
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
@@ -49,6 +49,6 @@ class account_analytic_cost_ledger(osv.osv_memory):
 
         datas['form']['active_ids'] = context.get('active_ids', False)
 
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledger', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticcostledger', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py
index ad79c0b33f6806ac3fba3eba930a2be11ed5a971..93946960297d32831c467546dafe2fbb96af0e55 100644
--- a/addons/account/project/wizard/account_analytic_inverted_balance_report.py
+++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.py
@@ -47,6 +47,6 @@ class account_analytic_inverted_balance(osv.osv_memory):
             'form': data
         }
         datas['form']['active_ids'] = context.get('active_ids', False)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_invertedanalyticbalance', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_invertedanalyticbalance', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_journal_report.py b/addons/account/project/wizard/account_analytic_journal_report.py
index f2e406bc3a55f38b7bc32cb563c75d31cdf00866..d8790e805d87b85e0491b7bd50259908ecf7c1c0 100644
--- a/addons/account/project/wizard/account_analytic_journal_report.py
+++ b/addons/account/project/wizard/account_analytic_journal_report.py
@@ -57,7 +57,7 @@ class account_analytic_journal_report(osv.osv_memory):
         context2 = context.copy()
         context2['active_model'] = 'account.analytic.journal'
         context2['active_ids'] = ids_list
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticjournal', data=datas, context=context2)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticjournal', data=datas, context=context2)
 
     def default_get(self, cr, uid, fields, context=None):
         if context is None:
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml
index 6757095a7d4ecedf51f9066a01084ac75cb71c9c..6c4b701c6cf375848e38705512e184464d56e86d 100644
--- a/addons/account/views/report_invoice.xml
+++ b/addons/account/views/report_invoice.xml
@@ -47,7 +47,6 @@
                     <tr>
                         <th>Description</th>
                         <th>Quantity</th>
-                        <th groups="product.group_uom">Unit of measure</th>
                         <th class="text-right">Unit Price</th>
                         <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
                         <th class="text-right">Taxes</th>
@@ -57,8 +56,10 @@
                 <tbody class="invoice_tbody">
                     <tr t-foreach="o.invoice_line" t-as="l">
                         <td><span t-field="l.name"/></td>
-                        <td><span t-field="l.quantity"/></td>
-                        <td groups="product.group_uom"><span t-field="l.uos_id"/></td>
+                        <td>
+                            <span t-field="l.quantity"/>
+                            <span t-field="l.uos_id"  groups="product.group_uom"/>
+                        </td>
                         <td class="text-right">
                             <span t-field="l.price_unit"/>
                         </td>
@@ -100,7 +101,7 @@
             </div>
 
             <div class="row" t-if="o.tax_line">
-                <div class="col-xs-3">
+                <div class="col-xs-6">
                     <table class="table table-condensed">
                         <thead>
                             <tr>
@@ -136,7 +137,7 @@
             </p>
             <p t-if="o.fiscal_position">
                 <strong>Fiscal Position:</strong>
-                <span t-field="o.fiscal_position.note"/>
+                <span t-field="o.fiscal_position"/>
             </p>
         </div>
     </t>
diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py
index 6c1b57fa42842401b9ea564ac6827c4c7da43769..721e47193a218108f35b3fa423f8d6aa2d798791 100644
--- a/addons/account/wizard/account_financial_report.py
+++ b/addons/account/wizard/account_financial_report.py
@@ -89,6 +89,6 @@ class accounting_report(osv.osv_memory):
 
     def _print_report(self, cr, uid, ids, data, context=None):
         data['form'].update(self.read(cr, uid, ids, ['date_from_cmp',  'debit_credit', 'date_to_cmp',  'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp',  'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter','target_move'], context=context)[0])
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_financial', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_financial', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_account_balance.py b/addons/account/wizard/account_report_account_balance.py
index 3b9d3c2177789c168a7c4022005e8aaa0996d3a0..9eba5f24b997fe48ea70545b081d5950e27cabe4 100644
--- a/addons/account/wizard/account_report_account_balance.py
+++ b/addons/account/wizard/account_report_account_balance.py
@@ -21,6 +21,7 @@
 
 from openerp.osv import fields, osv
 
+
 class account_balance_report(osv.osv_memory):
     _inherit = "account.common.account.report"
     _name = 'account.balance.report'
@@ -36,6 +37,6 @@ class account_balance_report(osv.osv_memory):
 
     def _print_report(self, cr, uid, ids, data, context=None):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_trialbalance', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_trialbalance', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py
index c918a1119fd31351eb5b946cc736b01d29fce6cd..d7b57eaba02e2b1d91abf3b8001f59ce7bb6b910 100644
--- a/addons/account/wizard/account_report_aged_partner_balance.py
+++ b/addons/account/wizard/account_report_aged_partner_balance.py
@@ -81,6 +81,6 @@ class account_aged_trial_balance(osv.osv_memory):
         data['form'].update(res)
         if data.get('form',False):
             data['ids']=[data['form'].get('chart_account_id',False)]
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_agedpartnerbalance', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_agedpartnerbalance', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_central_journal.py b/addons/account/wizard/account_report_central_journal.py
index 9f22d49afac1ec664f96384b84efad96d6d18e2e..a31fef91ae486d04099f52dcf0177f08ff08e7f6 100644
--- a/addons/account/wizard/account_report_central_journal.py
+++ b/addons/account/wizard/account_report_central_journal.py
@@ -21,6 +21,7 @@
 
 from openerp.osv import fields, osv
 
+
 class account_central_journal(osv.osv_memory):
     _name = 'account.central.journal'
     _description = 'Account Central Journal'
@@ -32,6 +33,6 @@ class account_central_journal(osv.osv_memory):
 
     def _print_report(self, cr, uid, ids, data, context=None):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_centraljournal', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_centraljournal', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_general_journal.py b/addons/account/wizard/account_report_general_journal.py
index 3d9d55b19c1081c9a406b8cd1ab6dcb3a32b9524..c35a59204287c4cdb3426d5fef97b0de499129b7 100644
--- a/addons/account/wizard/account_report_general_journal.py
+++ b/addons/account/wizard/account_report_general_journal.py
@@ -21,6 +21,7 @@
 
 from openerp.osv import fields, osv
 
+
 class account_general_journal(osv.osv_memory):
     _inherit = "account.common.journal.report"
     _name = 'account.general.journal'
@@ -32,6 +33,6 @@ class account_general_journal(osv.osv_memory):
 
     def _print_report(self, cr, uid, ids, data, context=None):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_generaljournal', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_generaljournal', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py
index c75477da40a76092d8634f321f77fa11a13d55ad..5f0a302d7207d01e0425f6012f8fb6685e27e298 100644
--- a/addons/account/wizard/account_report_general_ledger.py
+++ b/addons/account/wizard/account_report_general_ledger.py
@@ -59,6 +59,6 @@ class account_report_general_ledger(osv.osv_memory):
         if data['form']['landscape'] is False:
             data['form'].pop('landscape')
 
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_generalledger', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_generalledger', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_partner_balance.py b/addons/account/wizard/account_report_partner_balance.py
index d4b5fb27d1419067ab63f3e56ec2639608fc294f..7485bec67fe2e02a13317bd4345b3c7aa790b993 100644
--- a/addons/account/wizard/account_report_partner_balance.py
+++ b/addons/account/wizard/account_report_partner_balance.py
@@ -44,6 +44,6 @@ class account_partner_balance(osv.osv_memory):
             context = {}
         data = self.pre_print_report(cr, uid, ids, data, context=context)
         data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerbalance', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerbalance', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py
index eb743e32e4f0dc984d0a78cb90f9986f45b69424..38ff6988fd7004179d09b8cdc255a26612e5faed 100644
--- a/addons/account/wizard/account_report_partner_ledger.py
+++ b/addons/account/wizard/account_report_partner_ledger.py
@@ -58,7 +58,7 @@ class account_partner_ledger(osv.osv_memory):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
         data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'filter', 'page_split', 'amount_currency'])[0])
         if data['form'].get('page_split') is True: 
-            return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledgerother', data=data, context=context)
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledger', data=data, context=context)
+            return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerledgerother', data=data, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerledger', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_print_journal.py b/addons/account/wizard/account_report_print_journal.py
index 3aafc63acf4a662347cacacfcc532eb35533cbd1..1f6b6e0cf4d1a79fd6b3c33e58aa6eec15da660d 100644
--- a/addons/account/wizard/account_report_print_journal.py
+++ b/addons/account/wizard/account_report_print_journal.py
@@ -67,8 +67,8 @@ class account_print_journal(osv.osv_memory):
         data = self.pre_print_report(cr, uid, ids, data, context=context)
         data['form'].update(self.read(cr, uid, ids, ['sort_selection'], context=context)[0])
         if context.get('sale_purchase_only'):
-            return self.pool['report'].get_action(cr, uid, ids, 'account.report_salepurchasejournal', data=data, context=context)
+            return self.pool['report'].get_action(cr, uid, [], 'account.report_salepurchasejournal', data=data, context=context)
         else:
-            return self.pool['report'].get_action(cr, uid, ids, 'account.report_journal', data=data, context=context)
+            return self.pool['report'].get_action(cr, uid, [], 'account.report_journal', data=data, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py
index 5cc5c678df1b8a6b00e5c8da9b2d2cbd1a332279..e7c806be2f9b12bba1d71c684cac94c6913aad34 100644
--- a/addons/account/wizard/account_vat.py
+++ b/addons/account/wizard/account_vat.py
@@ -61,6 +61,6 @@ class account_vat_declaration(osv.osv_memory):
         taxcode = taxcode_obj.browse(cr, uid, [taxcode_id], context=context)[0]
         datas['form']['company_id'] = taxcode.company_id.id
 
-        return self.pool['report'].get_action(cr, uid, ids, 'account.report_vat', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account.report_vat', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 2205d52065b61faa50337a7b017ef12c3a4886aa..785d7cd6db07de86a8389d04c18cd64b3cb52474 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -73,9 +73,7 @@ class account_analytic_invoice_line(osv.osv):
 
         result = {}
         res = self.pool.get('product.product').browse(cr, uid, product, context=context)
-        result.update({'name':res.partner_ref or False,'uom_id': uom_id or res.uom_id.id or False, 'price_unit': res.list_price or 0.0})
-        if res.description:
-            result['name'] += '\n'+res.description
+        result.update({'name': name or res.description or False,'uom_id': uom_id or res.uom_id.id or False, 'price_unit': price_unit or res.list_price or 0.0})
 
         res_final = {'value':result}
         if result['uom_id'] != res.uom_id.id:
@@ -544,18 +542,17 @@ class account_analytic_account(osv.osv):
             'nodestroy': True,
         }
 
-    def on_change_template(self, cr, uid, ids, template_id, date_start=False, fix_price_invoices=False, invoice_on_timesheets=False, recurring_invoices=False, context=None):
+    def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
         if not template_id:
             return {}
-        obj_analytic_line = self.pool.get('account.analytic.invoice.line')
         res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
 
         template = self.browse(cr, uid, template_id, context=context)
         
-        if not fix_price_invoices:
+        if not ids:
             res['value']['fix_price_invoices'] = template.fix_price_invoices
             res['value']['amount_max'] = template.amount_max
-        if not invoice_on_timesheets:
+        if not ids:
             res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets
             res['value']['hours_qtt_est'] = template.hours_qtt_est
         
@@ -563,7 +560,7 @@ class account_analytic_account(osv.osv):
             res['value']['to_invoice'] = template.to_invoice.id
         if template.pricelist_id.id:
             res['value']['pricelist_id'] = template.pricelist_id.id
-        if not recurring_invoices:
+        if not ids:
             invoice_line_ids = []
             for x in template.recurring_invoice_line_ids:
                 invoice_line_ids.append((0, 0, {
@@ -654,12 +651,10 @@ class account_analytic_account(osv.osv):
             'nodestroy': True,
         }
 
-    def _prepare_invoice(self, cr, uid, contract, context=None):
+    def _prepare_invoice_data(self, cr, uid, contract, context=None):
         context = context or {}
 
-        inv_obj = self.pool.get('account.invoice')
         journal_obj = self.pool.get('account.journal')
-        fpos_obj = self.pool.get('account.fiscal.position')
 
         if not contract.partner_id:
             raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name )
@@ -680,33 +675,36 @@ class account_analytic_account(osv.osv):
         elif contract.company_id:
             currency_id = contract.company_id.currency_id.id
 
-        inv_data = {
-           'reference': contract.code or False,
+        invoice = {
            'account_id': contract.partner_id.property_account_receivable.id,
            'type': 'out_invoice',
            'partner_id': contract.partner_id.id,
            'currency_id': currency_id,
            'journal_id': len(journal_ids) and journal_ids[0] or False,
            'date_invoice': contract.recurring_next_date,
-           'origin': contract.name,
+           'origin': contract.code,
            'fiscal_position': fpos and fpos.id,
            'payment_term': partner_payment_term,
            'company_id': contract.company_id.id or False,
         }
-        invoice_id = inv_obj.create(cr, uid, inv_data, context=context)
+        return invoice
 
+    def _prepare_invoice_lines(self, cr, uid, contract, fiscal_position_id, context=None):
+        fpos_obj = self.pool.get('account.fiscal.position')
+        fiscal_position = fpos_obj.browse(cr, uid,  fiscal_position_id, context=context)
+        invoice_lines = []
         for line in contract.recurring_invoice_line_ids:
 
             res = line.product_id
             account_id = res.property_account_income.id
             if not account_id:
                 account_id = res.categ_id.property_account_income_categ.id
-            account_id = fpos_obj.map_account(cr, uid, fpos, account_id)
+            account_id = fpos_obj.map_account(cr, uid, fiscal_position, account_id)
 
             taxes = res.taxes_id or False
-            tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
+            tax_id = fpos_obj.map_tax(cr, uid, fiscal_position, taxes)
 
-            invoice_line_vals = {
+            invoice_lines.append((0, 0, {
                 'name': line.name,
                 'account_id': account_id,
                 'account_analytic_id': contract.id,
@@ -714,13 +712,14 @@ class account_analytic_account(osv.osv):
                 'quantity': line.quantity,
                 'uos_id': line.uom_id.id or False,
                 'product_id': line.product_id.id or False,
-                'invoice_id' : invoice_id,
                 'invoice_line_tax_id': [(6, 0, tax_id)],
-            }
-            self.pool.get('account.invoice.line').create(cr, uid, invoice_line_vals, context=context)
+            }))
+        return invoice_lines
 
-        inv_obj.button_compute(cr, uid, [invoice_id], context=context)
-        return invoice_id
+    def _prepare_invoice(self, cr, uid, contract, context=None):
+        invoice = self._prepare_invoice_data(cr, uid, contract, context=context)
+        invoice['invoice_line'] = self._prepare_invoice_lines(cr, uid, contract, invoice['fiscal_position'], context=context)
+        return invoice
 
     def recurring_create_invoice(self, cr, uid, ids, context=None):
         return self._recurring_create_invoice(cr, uid, ids, context=context)
@@ -730,6 +729,7 @@ class account_analytic_account(osv.osv):
 
     def _recurring_create_invoice(self, cr, uid, ids, automatic=False, context=None):
         context = context or {}
+        invoice_ids = []
         current_date =  time.strftime('%Y-%m-%d')
         if ids:
             contract_ids = ids
@@ -737,8 +737,8 @@ class account_analytic_account(osv.osv):
             contract_ids = self.search(cr, uid, [('recurring_next_date','<=', current_date), ('state','=', 'open'), ('recurring_invoices','=', True), ('type', '=', 'contract')])
         for contract in self.browse(cr, uid, contract_ids, context=context):
             try:
-                invoice_id = self._prepare_invoice(cr, uid, contract, context=context)
-
+                invoice_values = self._prepare_invoice(cr, uid, contract, context=context)
+                invoice_ids.append(self.pool['account.invoice'].create(cr, uid, invoice_values, context=context))
                 next_date = datetime.datetime.strptime(contract.recurring_next_date or current_date, "%Y-%m-%d")
                 interval = contract.recurring_interval
                 if contract.recurring_rule_type == 'daily':
@@ -756,7 +756,7 @@ class account_analytic_account(osv.osv):
                     _logger.error(traceback.format_exc())
                 else:
                     raise
-        return True
+        return invoice_ids
 
 class account_analytic_account_summary_user(osv.osv):
     _name = "account_analytic_analysis.summary.user"
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 97fb15e929097466b36723d147b15cc4ef792f57..a6fe828926aa64e1268bb486651d93e829218c2d 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -38,9 +38,6 @@
                 <field name="partner_id" position="attributes">
                     <attribute name="attrs">{'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]}</attribute>
                 </field>
-                <field name="template_id" position="attributes">
-                    <attribute name="on_change">on_change_template(template_id, date_start, fix_price_invoices, invoice_on_timesheets, recurring_invoices)</attribute>
-                </field>
                 <xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
                 </xpath>
                 <xpath expr='//separator[@name="description"]' position='before'>
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
index ccac123c681ea64a261ed68970dfd200dc9d5cc8..1bdc91f2995824f8bf16878026c373b21f10ff42 100644
--- a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
@@ -24,6 +24,7 @@ import time
 from openerp.osv import fields, osv
 from openerp.tools.translate import _
 
+
 class account_crossovered_analytic(osv.osv_memory):
     _name = "account.crossovered.analytic"
     _description = "Print Crossovered Analytic"
@@ -65,6 +66,6 @@ class account_crossovered_analytic(osv.osv_memory):
              'model': 'account.analytic.account',
              'form': data
         }
-        return self.pool['report'].get_action(cr, uid, ids, 'account_analytic_plans.report_crossoveredanalyticplans', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_analytic_plans.report_crossoveredanalyticplans', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_analytic.py b/addons/account_budget/wizard/account_budget_analytic.py
index a58b804ebbf95ebe358d21b8131ae6e5d7d04cd3..bd3bbdc8d99c4ad00b971ec254b114c87a920092 100644
--- a/addons/account_budget/wizard/account_budget_analytic.py
+++ b/addons/account_budget/wizard/account_budget_analytic.py
@@ -46,6 +46,6 @@ class account_budget_analytic(osv.osv_memory):
             'form': data
         }
         datas['form']['ids'] = datas['ids']
-        return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_analyticaccountbudget', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_budget.report_analyticaccountbudget', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_crossovered_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py
index 96561df5af097616da583b20307db4d75734418b..e47ff5cb421157311147ed4a9d2f003f259aa420 100644
--- a/addons/account_budget/wizard/account_budget_crossovered_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_report.py
@@ -47,6 +47,6 @@ class account_budget_crossvered_report(osv.osv_memory):
         }
         datas['form']['ids'] = datas['ids']
         datas['form']['report'] = 'analytic-full'
-        return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_crossoveredbudget', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_budget.report_crossoveredbudget', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
index 6b676ecc684bedc9f52b840032fc2178cc95b34d..d79e6097787ff7dcf232463d2f072b599ab6ab3f 100644
--- a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
@@ -49,6 +49,6 @@ class account_budget_crossvered_summary_report(osv.osv_memory):
         }
         datas['form']['ids'] = datas['ids']
         datas['form']['report'] = 'analytic-one'
-        return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_crossoveredbudget', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_budget.report_crossoveredbudget', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_report.py b/addons/account_budget/wizard/account_budget_report.py
index 2308b5ff9ac82a89a4532ec1364b28789ade12a8..fb1814a91716ee63064678a94580e87d2dba455e 100644
--- a/addons/account_budget/wizard/account_budget_report.py
+++ b/addons/account_budget/wizard/account_budget_report.py
@@ -47,6 +47,6 @@ class account_budget_report(osv.osv_memory):
         }
         datas['form']['ids'] = datas['ids']
         datas['form']['report'] = 'analytic-full'
-        return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_budget', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_budget.report_budget', data=datas, context=context)
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_check_writing/account_voucher.py b/addons/account_check_writing/account_voucher.py
index c3abe28eef0c4b769b18161d720877586c835bce..779ff61be444296ea81a52568c0e9500033b593c 100644
--- a/addons/account_check_writing/account_voucher.py
+++ b/addons/account_check_writing/account_voucher.py
@@ -74,26 +74,17 @@ class account_voucher(osv.osv):
 
     def print_check(self, cr, uid, ids, context=None):
         if not ids:
-            return  {}
+            raise osv.except_osv(_('Printing error'), _('No check selected '))
 
-        check_layout_report = {
-            'top' : 'account.print.check.top',
-            'middle' : 'account.print.check.middle',
-            'bottom' : 'account.print.check.bottom',
+        data = {
+            'id': ids and ids[0],
+            'ids': ids,
         }
 
-        check_layout = self.browse(cr, uid, ids[0], context=context).company_id.check_layout
-        return {
-            'type': 'ir.actions.report.xml', 
-            'report_name':check_layout_report[check_layout],
-            'datas': {
-                    'model':'account.voucher',
-                    'id': ids and ids[0] or False,
-                    'ids': ids and ids or [],
-                    'report_type': 'pdf'
-                },
-            'nodestroy': True
-            }
+        return self.pool['report'].get_action(
+            cr, uid, [], 'account_check_writing.report_check', data=data, context=context
+        )
+
     def create(self, cr, uid, vals, context=None):
         if vals.get('amount') and vals.get('journal_id') and 'amount_in_word' not in vals:
             vals['amount_in_word'] = self._amount_to_text(cr, uid, vals['amount'], vals.get('currency_id') or \
diff --git a/addons/account_check_writing/wizard/account_check_batch_printing.py b/addons/account_check_writing/wizard/account_check_batch_printing.py
index c3a13e2c68771fb3207a11560fcfc0dafea0ef83..bf59557d9044fa099a308e7f211adac92d5797e1 100644
--- a/addons/account_check_writing/wizard/account_check_batch_printing.py
+++ b/addons/account_check_writing/wizard/account_check_batch_printing.py
@@ -20,9 +20,9 @@
 ##############################################################################
 
 from openerp.tools.translate import _
-
 from openerp.osv import fields, osv
 
+
 class account_check_write(osv.osv_memory):
     _name = 'account.check.write'
     _description = 'Prin Check in Batch'
@@ -64,23 +64,11 @@ class account_check_write(osv.osv_memory):
         ir_sequence_obj.write(cr, uid, sequence_id, {'number_next': new_value})
 
         #print the checks
-        check_layout_report = {
-            'top' : 'account.print.check.top',
-            'middle' : 'account.print.check.middle',
-            'bottom' : 'account.print.check.bottom',
+        data = {
+            'id': voucher_ids and voucher_ids[0],
+            'ids': voucher_ids,
         }
-        check_layout = voucher_obj.browse(cr, uid, voucher_ids[0], context=context).company_id.check_layout
-        if not check_layout:
-            check_layout = 'top'
-        return {
-            'type': 'ir.actions.report.xml', 
-            'report_name':check_layout_report[check_layout],
-            'datas': {
-                'model':'account.voucher',
-                'ids': voucher_ids,
-                'report_type': 'pdf'
-                },
-            'nodestroy': True
-            }
-
 
+        return self.pool['report'].get_action(
+            cr, uid, [], 'account_check_writing.report_check', data=data, context=context
+        )
diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py
index eae361913ade02eac98948cc40ed29c72b81f055..82ae10a0937f073be21a8a8745b55a47176a5a8a 100644
--- a/addons/account_followup/account_followup.py
+++ b/addons/account_followup/account_followup.py
@@ -188,7 +188,7 @@ class res_partner(osv.osv):
              'model': 'account_followup.followup',
              'form': data
         }
-        return self.pool['report'].get_action(cr, uid, wizard_partner_ids, 'account_followup.report_followup', data=datas, context=context)
+        return self.pool['report'].get_action(cr, uid, [], 'account_followup.report_followup', data=datas, context=context)
 
     def do_partner_mail(self, cr, uid, partner_ids, context=None):
         if context is None:
diff --git a/addons/auth_oauth/auth_oauth_view.xml b/addons/auth_oauth/auth_oauth_view.xml
index ffc39752ec6eeca4f6240023deb387dd329fecb7..5c889d3a68691019aa3ce759c904f7b6146ba090 100644
--- a/addons/auth_oauth/auth_oauth_view.xml
+++ b/addons/auth_oauth/auth_oauth_view.xml
@@ -11,6 +11,7 @@
                             <field name="name" />
                             <field name="client_id" />
                             <field name="enabled" />
+                            <field name="body" />
                         </group>
                         <group>
                             <field name="auth_endpoint" />
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 210b8c94225c384a0aacb502ad5e825e74720cc8..785f2a6e8ced4e39b82ccc2e465aacbed27a75d9 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -977,7 +977,7 @@ class crm_lead(format_address, osv.osv):
         if obj.type == 'opportunity':
             model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'crm_case_form_view_oppor')
         else:
-            view_id = super(crm_lead, self).get_formview_id(cr, uid, id, model=model, context=context)
+            view_id = super(crm_lead, self).get_formview_id(cr, uid, id, model='crm.lead', context=context)
         return view_id
 
     def message_get_suggested_recipients(self, cr, uid, ids, context=None):
diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml
index 1abcdac9712bd25281180862e1beb3faee8a490c..fef80bb8a5333ce7ab2436b2a68ace148846bcf8 100644
--- a/addons/crm/crm_lead_data.xml
+++ b/addons/crm/crm_lead_data.xml
@@ -14,6 +14,7 @@
         <record model="crm.case.stage" id="stage_lead2">
             <field name="name">Dead</field>
             <field name="case_default">1</field>
+            <field name="fold">1</field>
             <field name="probability">0</field>
             <field name="on_change">1</field>
             <field name="sequence">30</field>
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index c4cffdc012ac9bb5dc60c6cc4981943676907646..1dda471c2f23f95f1ae8da244f738493b3defed3 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -10,7 +10,7 @@
             <field name="arch" type="xml">
                 <graph string="Leads Analysis" type="pivot" stacked="True">
                     <field name="user_id" type="row"/>
-                    <field name="create_date" interval="week" type="col"/>
+                    <field name="create_date" interval="year" type="col"/>
                 </graph>
             </field>
         </record>
@@ -32,7 +32,6 @@
             <field name="arch" type="xml">
                 <graph string="Leads Analysis" type="pivot" stacked="True">
                     <field name="date_deadline" type="row"/>
-                    <field name="user_id" type="col"/>
                     <field name="stage_id" type="col"/>
                     <field name="planned_revenue" type="measure"/>
                 </graph>
@@ -46,6 +45,9 @@
             <field name="model">crm.lead.report</field>
             <field name="arch" type="xml">
                 <search string="Leads Analysis">
+                    <filter name="lead" string="Lead" domain="[('type','=', 'lead')]" help="Show only lead"/>
+                    <filter name="opportunity" string="Opportunity" domain="[('type','=','opportunity')]" help="Show only opportunity"/>
+                    <separator/>
                     <filter string="New" name="new"
                             domain="[('probability', '=', 0), ('stage_id.sequence', '=', 1)]"/>
                     <filter string="Won" name="won"
@@ -78,43 +80,37 @@
                         <field name="date_closed"/>
                     </group>
                     <group expand="1" string="Group By...">
-                        <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
-                        <filter string="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}" />
-                        <filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}" />
-                        <filter string="Country" icon="terp-go-home" context="{'group_by':'country_id'}" />
-                        <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
-                        <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
-                        <filter string="Priority"  icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
-                        <filter string="Campaign" icon="terp-gtk-jump-to-rtl"
-                            domain="[]" context="{'group_by':'type_id'}" />
-                        <filter string="Channel" icon="terp-call-start"
-                            domain="[]" context="{'group_by':'channel_id'}" />
+                        <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}" />
+                        <filter string="Sales Team" domain="[]" context="{'group_by':'section_id'}" />
+                        <filter string="Partner" context="{'group_by':'partner_id'}" />
+                        <filter string="Country" context="{'group_by':'country_id'}" />
+                        <filter string="Company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+                        <filter string="Type" domain="[]" context="{'group_by':'type'}"/>
+                        <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
+                        <filter string="Priority" domain="[]" context="{'group_by':'priority'}" />
+                        <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}" />
+                        <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}" />
                         <separator orientation="vertical" />
-                        <filter string="Creation date (day)" icon="terp-go-year"
-                            domain="[]" context="{'group_by':'create_date:day'}"/>
-                        <filter string="Creation date (week)" icon="terp-go-year"
-                            domain="[]" context="{'group_by':'create_date:week'}"/>
-                        <filter string="Creation date (month)" icon="terp-go-year"
-                            domain="[]" context="{'group_by':'create_date:month'}" name="month"/>
-                        <filter string="Creation date (year)" icon="terp-go-year"
-                            domain="[]" context="{'group_by':'create_date:year'}"/>
+                        <filter string="Creation date (day)" domain="[]" context="{'group_by':'create_date:day'}"/>
+                        <filter string="Creation date (week)" domain="[]" context="{'group_by':'create_date:week'}"/>
+                        <filter string="Creation date (month)" domain="[]" context="{'group_by':'create_date:month'}" name="month"/>
+                        <filter string="Creation date (year)" domain="[]" context="{'group_by':'create_date:year'}"/>
                         <separator orientation="vertical" />
-                        <filter string="Exp. Closing"  icon="terp-go-month"
-                            domain="[]" context="{'group_by':'date_deadline'}"/>
+                        <filter string="Exp. Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
                         <filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}" />
                     </group>
                 </search>
             </field>
         </record>
 
-<!-- Leads by user and section Action -->
-
+        <!-- Leads by user and section Action -->
        <record id="action_report_crm_lead" model="ir.actions.act_window">
            <field name="name">Leads Analysis</field>
            <field name="res_model">crm.lead.report</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph</field>
-           <field name="domain">[('type','=', 'lead')]</field>
+           <field name="context">{'search_default_lead': 1}</field>
+           <field name="domain">[]</field>
            <field name="help">Leads Analysis allows you to check different CRM related information like the treatment delays or number of leads per state. You can sort out your leads analysis by different groups to get accurate grained analysis.</field>
        </record>
        <record model="ir.actions.act_window.view" id="action_report_crm_lead_graph">
@@ -123,27 +119,25 @@
             <field name="view_id" ref="view_report_crm_lead_graph"/>
             <field name="act_window_id" ref="action_report_crm_lead"/>
        </record>
+       <menuitem name="Leads Analysis" id="menu_report_crm_leads_tree"
+            groups="base.group_sale_manager"
+            parent="base.next_id_64" action="action_report_crm_lead" sequence="1"/>
 
        <record id="action_report_crm_opportunity" model="ir.actions.act_window">
             <field name="name">Opportunities Analysis</field>
             <field name="res_model">crm.lead.report</field>
             <field name="view_type">form</field>
             <field name="view_mode">graph</field>
-            <field name="domain">[('type','=', 'opportunity')]</field>
+            <field name="context">{'search_default_opportunity': 1}</field>
+            <field name="domain">[]</field>
             <field name="help">Opportunities Analysis gives you an instant access to your opportunities with information such as the expected revenue, planned cost, missed deadlines or the number of interactions per opportunity. This report is mainly used by the sales manager in order to do the periodic review with the teams of the sales pipeline.</field>
         </record>
-
        <record model="ir.actions.act_window.view" id="action_report_crm_opportunity_graph">
             <field name="sequence" eval="2"/>
             <field name="view_mode">graph</field>
             <field name="view_id" ref="view_report_crm_opportunity_graph"/>
             <field name="act_window_id" ref="action_report_crm_opportunity"/>
        </record>
-
-       <menuitem name="Leads Analysis" id="menu_report_crm_leads_tree"
-            groups="base.group_sale_manager"
-            parent="base.next_id_64" action="action_report_crm_lead" sequence="1"/>
-
        <menuitem name="Opportunities Analysis" id="menu_report_crm_opportunities_tree"
             parent="base.next_id_64" action="action_report_crm_opportunity" sequence="5"/>
 
diff --git a/addons/crm/static/description/index.html b/addons/crm/static/description/index.html
index 70f52d0ca87c7f65734a822ef14532f4c3f8cb6c..d1fe80f0275e2bd78bef7284c592b20041831882 100644
--- a/addons/crm/static/description/index.html
+++ b/addons/crm/static/description/index.html
@@ -88,7 +88,7 @@ Find duplicates, merge leads and assign them to the right salesperson in one ope
             <p class="oe_mt32">
 Get your opportunities organized to stay focused on the best deals. Manage all your customer interactions from the opportunity like emails, phone calls, internal notes, meetings and quotations.
             </p><p>
-Follow opportunities that interrests you to get notified upon specific events: deal won or lost, stage changed, new customer demand, etc.
+Follow opportunities that interest you to get notified upon specific events: deal won or lost, stage changed, new customer demand, etc.
             </p>
         </div>
     </div>
diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py
index 8f474461cf75314b6bcf29c7e38112371226bbff..3827baaf1c5d791abd35c35f159b098ebaa5b22d 100644
--- a/addons/delivery/delivery.py
+++ b/addons/delivery/delivery.py
@@ -194,9 +194,9 @@ class delivery_grid(osv.osv):
         for line in order.order_line:
             if not line.product_id or line.is_delivery:
                 continue
-            total += line.price_subtotal or 0.0
             weight += (line.product_id.weight or 0.0) * line.product_uom_qty
             volume += (line.product_id.volume or 0.0) * line.product_uom_qty
+        total = order.amount_total or 0.0
 
 
         return self.get_price_from_picking(cr, uid, id, total,weight, volume, context=context)
diff --git a/addons/event/email_template.xml b/addons/event/email_template.xml
index d99774acd3cc5411cb56effe9246d4a0977daa86..d4479bcfc87ffadef7dd554719e40f087a72f816 100644
--- a/addons/event/email_template.xml
+++ b/addons/event/email_template.xml
@@ -9,7 +9,7 @@
         <field name="subject">Your registration at ${object.event_id.name}</field>
         <field name="body_html"><![CDATA[
         <p>Hello ${object.name},</p>
-        <p>The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}.
+        <p>The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin_located.strftime('%Y-%m-%d %H:%M:%S (%Z)')} to ${object.event_id.date_end_located.strftime('%Y-%m-%d %H:%M:%S (%Z)')}.
         For any further information please contact our event department.</p>
         <p>Thank you for your participation!</p>
         <p>Best regards</p>]]></field>
diff --git a/addons/event/event.py b/addons/event/event.py
index 94aab1e5e26a90bf00e28e96ad77c46657886a7f..8021cce19aeecf4b8cb072175811a978416a8a70 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -18,7 +18,8 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
-
+import pytz
+from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
 from datetime import datetime, timedelta
 from openerp.osv import fields, osv
 from openerp.tools.translate import _
@@ -131,7 +132,7 @@ class event_event(osv.osv):
         @return: Dictionary of function field values.
         """
         event_ids=set()
-        for registration in self.browse(cr, uid, ids, context=context):
+        for registration in self.pool['event.registration'].browse(cr, uid, ids, context=context):
             event_ids.add(registration.event_id.id)
         return list(event_ids)
 
@@ -150,6 +151,22 @@ class event_event(osv.osv):
                         continue
         return res
 
+    def _compute_date_tz(self, cr, uid, ids, fld, arg, context=None):
+        if context is None:
+            context = {}
+        res = {}
+        for event in self.browse(cr, uid, ids, context=context):
+            ctx = dict(context, tz=(event.date_tz or 'UTC'))
+            if fld == 'date_begin_located':
+                date_to_convert = event.date_begin
+            elif fld == 'date_end_located':
+                date_to_convert = event.date_end
+            res[event.id] = fields.datetime.context_timestamp(cr, uid, datetime.strptime(date_to_convert, DEFAULT_SERVER_DATETIME_FORMAT), context=ctx)
+        return res
+
+    def _tz_get(self, cr, uid, context=None):
+        return [(x, x) for x in pytz.all_timezones]
+
     _columns = {
         'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
         'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
@@ -169,8 +186,11 @@ class event_event(osv.osv):
             store={'event.registration': (_get_events_from_registrations, ['state'], 10),
                    'event.event': (lambda  self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
         'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
+        'date_tz': fields.selection(_tz_get, string='Timezone'),
         'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
         'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
+        'date_begin_located': fields.function(_compute_date_tz, string='Start Date Located', type="datetime"),
+        'date_end_located': fields.function(_compute_date_tz, string='End Date Located', type="datetime"),
         'state': fields.selection([
             ('draft', 'Unconfirmed'),
             ('cancel', 'Cancelled'),
@@ -197,7 +217,8 @@ class event_event(osv.osv):
         'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c),
         'user_id': lambda obj, cr, uid, context: uid,
         'organizer_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id,
-        'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id
+        'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, context=c).company_id.partner_id.id,
+        'date_tz': lambda self, cr, uid, ctx: ctx.get('tz', "UTC"),
     }
 
     def _check_seats_limit(self, cr, uid, ids, context=None):
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 2cdb74bea5bda82e67226a9c29d051c73b29166a..f608724c9a264223b26582760a0088f6e6e4d494 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -83,6 +83,7 @@
                                 <field name="type" on_change="onchange_event_type(type,context)" />
                                 <field name="date_begin" on_change="onchange_start_date(date_begin,date_end)"/>
                                 <field name="date_end"/>
+                                <field name="date_tz" />
                             </group>
                         </group>
                         <notebook>
diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py
index 0f2b1edbca0e7fddd261ad607c92785d76bccaa8..b4f42673abaef12099e30c15aa9c42f4275b4bd9 100644
--- a/addons/event_sale/event_sale.py
+++ b/addons/event_sale/event_sale.py
@@ -139,10 +139,16 @@ class event_event(osv.osv):
         return []
 
     def _get_ticket_events(self, cr, uid, ids, context=None):
-        # `self` is the event.event.ticket model here! 
+        # `self` is the event.event.ticket model when called by ORM! 
         return list(set(ticket.event_id.id
                             for ticket in self.browse(cr, uid, ids, context)))
 
+    # proxy method, can't import parent method directly as unbound_method: it would receive
+    # an invalid `self` <event_registration> when called by ORM
+    def _events_from_registrations(self, cr, uid, ids, context=None):
+        # `self` is the event.registration model when called by ORM
+        return self.pool['event.event']._get_events_from_registrations(cr, uid, ids, context=context)
+
     _columns = {
         'event_ticket_ids': fields.one2many('event.event.ticket', "event_id", "Event Ticket"),
         'seats_max': fields.function(_get_seats_max,
@@ -154,7 +160,7 @@ class event_event(osv.osv):
         'seats_available': fields.function(Event._get_seats, oldname='register_avail', string='Available Seats',
                                            type='integer', multi='seats_reserved',
                                            store={
-                                              'event.registration': (Event._get_events_from_registrations, ['state'], 10),
+                                              'event.registration': (_events_from_registrations, ['state'], 10),
                                               'event.event': (lambda self, cr, uid, ids, c = {}: ids,
                                                               ['seats_max', 'registration_ids'], 20),
                                               'event.event.ticket': (_get_ticket_events, ['seats_max'], 10),
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index ecb4c495d9403cd57af43a5c8616865cacb8cac6..63c23f30cff65857e47ee916f0b6b1a83782096a 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -217,15 +217,7 @@ class gamification_challenge(osv.Model):
                 vals['user_ids'] = []
             vals['user_ids'] += [(4, user_id) for user_id in user_ids]
 
-        create_res = super(gamification_challenge, self).create(cr, uid, vals, context=context)
-
-        # subscribe new users to the challenge
-        if vals.get('user_ids'):
-            # done with browse after super to be sure catch all after orm process
-            challenge = self.browse(cr, uid, create_res, context=context)
-            self.message_subscribe_users(cr, uid, [challenge.id], [user.id for user in challenge.user_ids], context=context)
-
-        return create_res
+        return super(gamification_challenge, self).create(cr, uid, vals, context=context)
 
     def write(self, cr, uid, ids, vals, context=None):
         if isinstance(ids, (int,long)):
@@ -240,6 +232,11 @@ class gamification_challenge(osv.Model):
 
         write_res = super(gamification_challenge, self).write(cr, uid, ids, vals, context=context)
 
+        if vals.get('report_message_frequency', 'never') != 'never':
+            # _recompute_challenge_users do not set users for challenges with no reports, subscribing them now
+            for challenge in self.browse(cr, uid, ids, context=context):
+                self.message_subscribe(cr, uid, [challenge.id], [user.partner_id.id for user in challenge.user_ids], context=context)
+
         if vals.get('state') == 'inprogress':
             self._recompute_challenge_users(cr, uid, ids, context=context)
             self._generate_goals_from_challenge(cr, uid, ids, context=context)
@@ -264,6 +261,9 @@ class gamification_challenge(osv.Model):
         - Create the missing goals (eg: modified the challenge to add lines)
         - Update every running challenge
         """
+        if context is None:
+            context = {}
+
         # start scheduled challenges
         planned_challenge_ids = self.search(cr, uid, [
             ('state', '=', 'draft'),
@@ -281,6 +281,9 @@ class gamification_challenge(osv.Model):
         if not ids:
             ids = self.search(cr, uid, [('state', '=', 'inprogress')], context=context)
 
+        # in cron mode, will do intermediate commits
+        # TODO in trunk: replace by parameter
+        context.update({'commit_gamification': True})
         return self._update_all(cr, uid, ids, context=context)
 
     def _update_all(self, cr, uid, ids, context=None):
@@ -355,11 +358,6 @@ class gamification_challenge(osv.Model):
                 if write_op:
                     self.write(cr, uid, [challenge.id], {'user_ids': write_op}, context=context)
 
-                if to_remove_ids:
-                    self.message_unsubscribe_users(cr, uid, [challenge.id], to_remove_ids, context=None)
-                if to_add_ids:
-                    self.message_subscribe_users(cr, uid, [challenge.id], to_add_ids, context=context)
-
         return True
 
 
@@ -393,9 +391,9 @@ class gamification_challenge(osv.Model):
         :param list(int) ids: the list of challenge concerned"""
 
         goal_obj = self.pool.get('gamification.goal')
-        to_update = []
         for challenge in self.browse(cr, uid, ids, context=context):
             (start_date, end_date) = start_end_date_for_period(challenge.period)
+            to_update = []
 
             # if no periodicity, use challenge dates
             if not start_date and challenge.start_date:
@@ -426,7 +424,15 @@ class gamification_challenge(osv.Model):
 
                 cr.execute(query, query_params)
                 user_with_goal_ids = cr.dictfetchall()
-                user_without_goal_ids = list(set([user.id for user in challenge.user_ids]) - set([user['user_id'] for user in user_with_goal_ids]))
+
+                participant_user_ids = [user.id for user in challenge.user_ids]
+                user_without_goal_ids = list(set(participant_user_ids) - set([user['user_id'] for user in user_with_goal_ids]))
+                user_squating_challenge_ids = list(set([user['user_id'] for user in user_with_goal_ids]) - set(participant_user_ids))
+                if user_squating_challenge_ids:
+                    # users that used to match the challenge 
+                    goal_to_remove_ids = goal_obj.search(cr, uid, [('challenge_id', '=', challenge.id), ('user_id', 'in', user_squating_challenge_ids)], context=context)
+                    goal_obj.unlink(cr, uid, goal_to_remove_ids, context=context)
+
 
                 values = {
                     'definition_id': line.definition_id.id,
@@ -614,9 +620,10 @@ class gamification_challenge(osv.Model):
             ctx.update({'challenge_lines': lines_boards})
             body_html = temp_obj.render_template(cr, uid, challenge.report_template_id.body_html, 'gamification.challenge', challenge.id, context=ctx)
 
-            # send to every follower of the challenge
+            # send to every follower and participant of the challenge
             self.message_post(cr, uid, challenge.id,
                 body=body_html,
+                partner_ids=[user.partner_id.id for user in challenge.user_ids],
                 context=context,
                 subtype='mail.mt_comment')
             if challenge.report_message_group_id:
@@ -698,34 +705,35 @@ class gamification_challenge(osv.Model):
             rewarded_users = []
             challenge_ended = end_date == yesterday.strftime(DF) or force
             if challenge.reward_id and challenge_ended or challenge.reward_realtime:
-                for user in challenge.user_ids:
-                    reached_goal_ids = self.pool.get('gamification.goal').search(cr, uid, [
-                        ('challenge_id', '=', challenge.id),
-                        ('user_id', '=', user.id),
-                        ('start_date', '=', start_date),
-                        ('end_date', '=', end_date),
-                        ('state', '=', 'reached')
-                    ], context=context)
-                    if len(reached_goal_ids) == len(challenge.line_ids):
+                # not using start_date as intemportal goals have a start date but no end_date
+                reached_goals = self.pool.get('gamification.goal').read_group(cr, uid, [
+                    ('challenge_id', '=', challenge.id),
+                    ('end_date', '=', end_date),
+                    ('state', '=', 'reached')
+                ], fields=['user_id'], groupby=['user_id'], context=context)
+                for reach_goals_user in reached_goals:
+                    if reach_goals_user['user_id_count'] == len(challenge.line_ids):
                         # the user has succeeded every assigned goal
+                        user_id = reach_goals_user['user_id'][0]
                         if challenge.reward_realtime:
                             badges = self.pool['gamification.badge.user'].search(cr, uid, [
                                 ('challenge_id', '=', challenge.id),
                                 ('badge_id', '=', challenge.reward_id.id),
-                                ('user_id', '=', user.id),
+                                ('user_id', '=', user_id),
                             ], count=True, context=context)
                             if badges > 0:
                                 # has already recieved the badge for this challenge
                                 continue
-                        self.reward_user(cr, uid, user.id, challenge.reward_id.id, challenge.id, context=context)
-                        rewarded_users.append(user)
+                        self.reward_user(cr, uid, user_id, challenge.reward_id.id, challenge.id, context=context)
+                        rewarded_users.append(user_id)
 
             if challenge_ended:
                 # open chatter message
                 message_body = _("The challenge %s is finished." % challenge.name)
 
                 if rewarded_users:
-                    message_body += _("<br/>Reward (badge %s) for every succeeding user was sent to %s." % (challenge.reward_id.name, ", ".join([user.name for user in rewarded_users])))
+                    user_names = self.pool['res.users'].name_get(cr, uid, rewarded_users, context=context)
+                    message_body += _("<br/>Reward (badge %s) for every succeeding user was sent to %s." % (challenge.reward_id.name, ", ".join([name for (user_id, name) in user_names])))
                 else:
                     message_body += _("<br/>Nobody has succeeded to reach every goal, no badge is rewared for this challenge.")
 
@@ -746,7 +754,10 @@ class gamification_challenge(osv.Model):
                         self.reward_user(cr, uid, third_user.id, challenge.reward_second_id.id, challenge.id, context=context)
                         message_body += "<br/> 3. %s - %s" % (third_user.name, challenge.reward_third_id.name)
 
-                self.message_post(cr, uid, challenge.id, body=message_body, context=context)
+                self.message_post(cr, uid, challenge.id,
+                    partner_ids=[user.partner_id.id for user in challenge.user_ids],
+                    body=message_body,
+                    context=context)
 
         return True
 
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index af9a763236d98ca1ebb58c786fba26d0a1044eb4..b4a47a0d07a0af0c56e11b7828c6cbeb2c71cdb4 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -138,7 +138,6 @@ class gamification_goal(osv.Model):
 
     _name = 'gamification.goal'
     _description = 'Gamification goal instance'
-    _inherit = 'mail.thread'
 
     def _get_completion(self, cr, uid, ids, field_name, arg, context=None):
         """Return the percentage of completeness of the goal, between 0 and 100"""
@@ -226,8 +225,7 @@ class gamification_goal(osv.Model):
                 temp_obj = self.pool.get('email.template')
                 template_id = self.pool['ir.model.data'].get_object(cr, uid, 'gamification', 'email_template_goal_reminder', context)
                 body_html = temp_obj.render_template(cr, uid, template_id.body_html, 'gamification.goal', goal.id, context=context)
-
-                self.message_post(cr, uid, goal.id, body=body_html, partner_ids=[goal.user_id.partner_id.id], context=context, subtype='mail.mt_comment')
+                self.pool['mail.thread'].message_post(cr, uid, 0, body=body_html, partner_ids=[goal.user_id.partner_id.id], context=context, subtype='mail.mt_comment')
                 return {'to_update': True}
         return {}
 
@@ -241,9 +239,9 @@ class gamification_goal(osv.Model):
         the target value being reached, the goal is set as failed."""
         if context is None:
             context = {}
+        commit = context.get('commit_gamification', False)
 
         goals_by_definition = {}
-        goals_to_write = {}
         all_goals = {}
         for goal in self.browse(cr, uid, ids, context=context):
             if goal.state in ('draft', 'canceled'):
@@ -251,10 +249,10 @@ class gamification_goal(osv.Model):
                 continue
 
             goals_by_definition.setdefault(goal.definition_id, []).append(goal)
-            goals_to_write[goal.id] = {}
             all_goals[goal.id] = goal
 
         for definition, goals in goals_by_definition.items():
+            goals_to_write = dict((goal.id, {}) for goal in goals)
             if definition.computation_mode == 'manually':
                 for goal in goals:
                     goals_to_write[goal.id].update(self._check_remind_delay(cr, uid, goal, context))
@@ -345,22 +343,24 @@ class gamification_goal(osv.Model):
                         if new_value != goal.current:
                             goals_to_write[goal.id]['current'] = new_value
 
-        for goal_id, value in goals_to_write.items():
-            if not value:
-                continue
-            goal = all_goals[goal_id]
-
-            # check goal target reached
-            if (goal.definition_condition == 'higher' and value.get('current', goal.current) >= goal.target_goal) \
-              or (goal.definition_condition == 'lower' and value.get('current', goal.current) <= goal.target_goal):
-                value['state'] = 'reached'
-
-            # check goal failure
-            elif goal.end_date and fields.date.today() > goal.end_date:
-                value['state'] = 'failed'
-                value['closed'] = True
-            if value:
-                self.write(cr, uid, [goal.id], value, context=context)
+            for goal_id, value in goals_to_write.items():
+                if not value:
+                    continue
+                goal = all_goals[goal_id]
+
+                # check goal target reached
+                if (goal.definition_condition == 'higher' and value.get('current', goal.current) >= goal.target_goal) \
+                  or (goal.definition_condition == 'lower' and value.get('current', goal.current) <= goal.target_goal):
+                    value['state'] = 'reached'
+
+                # check goal failure
+                elif goal.end_date and fields.date.today() > goal.end_date:
+                    value['state'] = 'failed'
+                    value['closed'] = True
+                if value:
+                    self.write(cr, uid, [goal.id], value, context=context)
+            if commit:
+                cr.commit()
         return True
 
     def action_start(self, cr, uid, ids, context=None):
diff --git a/addons/gamification/static/src/js/gamification.js b/addons/gamification/static/src/js/gamification.js
index 242f67d875922a2c2b5392668ed4cd1dc9de760f..6e2e52019689110ad1f8fecedc58442bc722c567 100644
--- a/addons/gamification/static/src/js/gamification.js
+++ b/addons/gamification/static/src/js/gamification.js
@@ -118,7 +118,7 @@ openerp.gamification = function(instance) {
         }
     });
 
-    instance.mail.Widget.include({
+    instance.mail.Wall.include({
         start: function() {
             this._super();
             var sidebar = new instance.gamification.Sidebar(this);
diff --git a/addons/gamification/views/goal.xml b/addons/gamification/views/goal.xml
index 528d5db05110e275d6adc71bd76f140cfa7ca8f1..884467404ce19c8208f1decf05a8aa4274920a97 100644
--- a/addons/gamification/views/goal.xml
+++ b/addons/gamification/views/goal.xml
@@ -86,10 +86,6 @@
                             </group>
                         </group>
                     </sheet>
-                    <div class="oe_chatter">
-                        <field name="message_follower_ids" widget="mail_followers"/>
-                        <field name="message_ids" widget="mail_thread"/>
-                    </div>
                 </form>
             </field>
         </record>
diff --git a/addons/gamification_sale_crm/sale_crm_goals_demo.xml b/addons/gamification_sale_crm/sale_crm_goals_demo.xml
index d8e26551c325eaf2ca55389aaac5919f47f1f865..b149af31f48b636986e8cf5135b23325f04a9112 100644
--- a/addons/gamification_sale_crm/sale_crm_goals_demo.xml
+++ b/addons/gamification_sale_crm/sale_crm_goals_demo.xml
@@ -4,18 +4,6 @@
 
         <!-- challenges -->
         <record model="gamification.challenge" id="challenge_crm_sale">
-            <field name="user_ids" eval="[(4,ref('base.user_demo'))]" />
-            <field name="state">inprogress</field>
-        </record>
-
-        <!-- goals -->
-        <record model="gamification.goal" id="goal_crm_sale1">
-            <field name="definition_id" eval="ref('definition_crm_tot_invoices')" />
-            <field name="user_id" eval="ref('base.user_demo')" />
-            <field name="line_id" eval="ref('line_crm_sale1')" />
-            <field name="start_date" eval="time.strftime('%Y-%m-01')" />
-            <field name="end_date" eval="(DateTime.today().replace(day=1)+relativedelta(months=1, days=-1)).strftime('%Y-%m-%d')" />
-            <field name="target_goal">2000</field>
             <field name="state">inprogress</field>
         </record>
         
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index a13a1866493576c56554e5fb4cc10ffc2497d585..5bb172eb0820d6f0a250e0eb2b8975573c1d86c8 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -248,7 +248,13 @@ class hr_employee(osv.osv):
         'image': _get_default_image,
         'color': 0,
     }
-
+    
+    def copy_data(self, cr, uid, ids, default=None, context=None):
+        if default is None:
+            default = {}
+        default.update({'child_ids': False})
+        return super(hr_employee, self).copy_data(cr, uid, ids, default, context=context)
+        
     def _broadcast_welcome(self, cr, uid, employee_id, context=None):
         """ Broadcast the welcome message to all users in the employee company. """
         employee = self.browse(cr, uid, employee_id, context=context)
@@ -421,18 +427,23 @@ class hr_department(osv.osv):
             res.append((record['id'], name))
         return res
 
-    def copy(self, cr, uid, ids, default=None, context=None):
+    def copy_data(self, cr, uid, ids, default=None, context=None):
         if default is None:
             default = {}
-        default = default.copy()
         default['member_ids'] = []
-        return super(hr_department, self).copy(cr, uid, ids, default, context=context)
+        return super(hr_department, self).copy_data(cr, uid, ids, default, context=context)
 
 
 class res_users(osv.osv):
     _name = 'res.users'
     _inherit = 'res.users'
 
+    def copy_data(self, cr, uid, ids, default=None, context=None):
+        if default is None:
+            default = {}
+        default.update({'employee_ids': False})
+        return super(res_users, self).copy_data(cr, uid, ids, default, context=context)
+    
     _columns = {
         'employee_ids': fields.one2many('hr.employee', 'user_id', 'Related employees'),
     }
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 6c9156f6be013c8d2e66b6fe84ac719f129d33ef..403620965543a1f6dcd86f43efa78379d7d56b2a 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -20,10 +20,13 @@
 ##############################################################################
 
 import time
-from datetime import datetime, timedelta
+from datetime import datetime
 from dateutil.relativedelta import relativedelta
+from pytz import timezone
+import pytz
 
 from openerp.osv import fields, osv
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
 from openerp.tools.translate import _
 
 class hr_timesheet_sheet(osv.osv):
@@ -396,18 +399,56 @@ class hr_attendance(osv.osv):
             attendance_ids.extend([row[0] for row in cr.fetchall()])
         return attendance_ids
 
+    def _get_attendance_employee_tz(self, cr, uid, employee_id, date, context=None):
+        """ Simulate timesheet in employee timezone
+
+        Return the attendance date in string format in the employee
+        tz converted from utc timezone as we consider date of employee
+        timesheet is in employee timezone
+        """
+        employee_obj = self.pool['hr.employee']
+
+        tz = False
+        if employee_id:
+            employee = employee_obj.browse(cr, uid, employee_id, context=context)
+            tz = employee.user_id.partner_id.tz
+
+        if not date:
+            date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
+
+        att_tz = timezone(tz or 'utc')
+
+        attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
+        att_tz_dt = pytz.utc.localize(attendance_dt)
+        att_tz_dt = att_tz_dt.astimezone(att_tz)
+        # We take only the date omiting the hours as we compare with timesheet
+        # date_from which is a date format thus using hours would lead to
+        # be out of scope of timesheet
+        att_tz_date_str = datetime.strftime(att_tz_dt, DEFAULT_SERVER_DATE_FORMAT)
+        return att_tz_date_str
+
+    def _get_current_sheet(self, cr, uid, employee_id, date=False, context=None):
+
+        sheet_obj = self.pool['hr_timesheet_sheet.sheet']
+        if not date:
+            date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
+
+        att_tz_date_str = self._get_attendance_employee_tz(
+                cr, uid, employee_id,
+                date=date, context=context)
+        sheet_ids = sheet_obj.search(cr, uid,
+            [('date_from', '<=', att_tz_date_str),
+             ('date_to', '>=', att_tz_date_str),
+             ('employee_id', '=', employee_id)],
+            limit=1, context=context)
+        return sheet_ids and sheet_ids[0] or False
+
     def _sheet(self, cursor, user, ids, name, args, context=None):
-        sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
         res = {}.fromkeys(ids, False)
         for attendance in self.browse(cursor, user, ids, context=context):
-            date_to = datetime.strftime(datetime.strptime(attendance.name[0:10], '%Y-%m-%d'), '%Y-%m-%d %H:%M:%S')
-            sheet_ids = sheet_obj.search(cursor, user,
-                [('date_to', '>=', date_to), ('date_from', '<=', attendance.name),
-                 ('employee_id', '=', attendance.employee_id.id)],
-                context=context)
-            if sheet_ids:
-                # [0] because only one sheet possible for an employee between 2 dates
-                res[attendance.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0]
+            res[attendance.id] = self._get_current_sheet(
+                    cursor, user, attendance.employee_id.id, attendance.name,
+                    context=context)
         return res
 
     _columns = {
@@ -426,16 +467,18 @@ class hr_attendance(osv.osv):
     def create(self, cr, uid, vals, context=None):
         if context is None:
             context = {}
-        if 'sheet_id' in context:
-            ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
+
+        sheet_id = context.get('sheet_id') or self._get_current_sheet(cr, uid, vals.get('employee_id'), vals.get('name'), context=context)
+        if sheet_id:
+            att_tz_date_str = self._get_attendance_employee_tz(
+                    cr, uid, vals.get('employee_id'),
+                   date=vals.get('name'), context=context)
+            ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, sheet_id, context=context)
             if ts.state not in ('draft', 'new'):
-                raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
-        res = super(hr_attendance,self).create(cr, uid, vals, context=context)
-        if 'sheet_id' in context:
-            if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
-                raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \
-                        'date outside the current timesheet dates.'))
-        return res
+                raise osv.except_osv(_('Error!'), _('You can not enter an attendance in a submitted timesheet. Ask your manager to reset it before adding attendance.'))
+            elif ts.date_from > att_tz_date_str or ts.date_to < att_tz_date_str:
+                raise osv.except_osv(_('User Error!'), _('You can not enter an attendance date outside the current timesheet dates.'))
+        return super(hr_attendance,self).create(cr, uid, vals, context=context)
 
     def unlink(self, cr, uid, ids, *args, **kwargs):
         if isinstance(ids, (int, long)):
@@ -585,4 +628,3 @@ class res_company(osv.osv):
 
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py
index a913d3c067d67c8eef1b651e63011403f8a8b839..4a069cb542867ea91f69fe9ad3111949a9cce754 100644
--- a/addons/mail/controllers/main.py
+++ b/addons/mail/controllers/main.py
@@ -6,6 +6,7 @@ from openerp import SUPERUSER_ID
 from openerp import http
 from openerp.http import request
 from openerp.addons.web.controllers.main import content_disposition
+import mimetypes
 
 
 class MailController(http.Controller):
@@ -19,10 +20,11 @@ class MailController(http.Controller):
         if res:
             filecontent = base64.b64decode(res.get('base64'))
             filename = res.get('filename')
+            content_type = mimetypes.guess_type(filename)
             if filecontent and filename:
                 return request.make_response(
                     filecontent,
-                    headers=[('Content-Type', 'application/octet-stream'),
+                    headers=[('Content-Type', content_type[0] or 'application/octet-stream'),
                              ('Content-Disposition', content_disposition(filename))])
         return request.not_found()
 
diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py
index a32d82e221e7fb4d1253cda3a4a5e821ce1db593..9811fcd6aefcb7772cdcddc5103cd43a3b0c2e37 100644
--- a/addons/mail/mail_mail.py
+++ b/addons/mail/mail_mail.py
@@ -234,13 +234,17 @@ class mail_mail(osv.Model):
             :return: True
         """
         ir_mail_server = self.pool.get('ir.mail_server')
+        ir_attachment = self.pool['ir.attachment']
 
         for mail in self.browse(cr, SUPERUSER_ID, ids, context=context):
             try:
-                # handle attachments
-                attachments = []
-                for attach in mail.attachment_ids:
-                    attachments.append((attach.datas_fname, base64.b64decode(attach.datas)))
+                # load attachment binary data with a separate read(), as prefetching all
+                # `datas` (binary field) could bloat the browse cache, triggerring
+                # soft/hard mem limits with temporary data.
+                attachment_ids = [a.id for a in mail.attachment_ids]
+                attachments = [(a['datas_fname'], base64.b64decode(a['datas']))
+                                 for a in ir_attachment.read(cr, SUPERUSER_ID, attachment_ids,
+                                                             ['datas_fname', 'datas'])]
                 # specific behavior to customize the send email for notified partners
                 email_list = []
                 if mail.email_to:
@@ -289,6 +293,14 @@ class mail_mail(osv.Model):
                 # /!\ can't use mail.state here, as mail.refresh() will cause an error
                 # see revid:odo@openerp.com-20120622152536-42b2s28lvdv3odyr in 6.1
                 self._postprocess_sent_message(cr, uid, mail, context=context, mail_sent=mail_sent)
+                _logger.info('Mail with ID %r and Message-Id %r successfully sent', mail.id, mail.message_id)
+            except MemoryError:
+                # prevent catching transient MemoryErrors, bubble up to notify user or abort cron job
+                # instead of marking the mail as failed
+                _logger.exception('MemoryError while processing mail with ID %r and Msg-Id %r. '\
+                                      'Consider raising the --limit-memory-hard startup option',
+                                  mail.id, mail.message_id)
+                raise
             except Exception as e:
                 _logger.exception('failed sending mail.mail %s', mail.id)
                 mail.write({'state': 'exception'})
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index 112dff6bac6be881edbb28f8d31891c3e9ca4729..d2dcef4d85e02230a1c4ceea7ce3879fe3a240fc 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -434,14 +434,14 @@ class mail_thread(osv.AbstractModel):
         fol_obj.unlink(cr, SUPERUSER_ID, fol_ids, context=context)
         return res
 
-    def copy(self, cr, uid, id, default=None, context=None):
+    def copy_data(self, cr, uid, id, default=None, context=None):
         # avoid tracking multiple temporary changes during copy
         context = dict(context or {}, mail_notrack=True)
 
         default = default or {}
         default['message_ids'] = []
         default['message_follower_ids'] = []
-        return super(mail_thread, self).copy(cr, uid, id, default=default, context=context)
+        return super(mail_thread, self).copy_data(cr, uid, id, default=default, context=context)
 
     #------------------------------------------------------
     # Automatically log tracked fields
diff --git a/addons/mail/res_config.py b/addons/mail/res_config.py
index c19eb4a38ee29b74c7e09ebf25240a451c88421b..2c94b432dc31acdf6dcacf9c9b472ae4f8b7b41b 100644
--- a/addons/mail/res_config.py
+++ b/addons/mail/res_config.py
@@ -34,14 +34,14 @@ class project_configuration(osv.TransientModel):
     }
 
     def get_default_alias_domain(self, cr, uid, ids, context=None):
-        alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", context=context)
-        if not alias_domain:
+        alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", default=None, context=context)
+        if alias_domain is None:
             domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context)
             try:
                 alias_domain = urlparse.urlsplit(domain).netloc.split(':')[0]
             except Exception:
                 pass
-        return {'alias_domain': alias_domain}
+        return {'alias_domain': alias_domain or False}
 
     def set_alias_domain(self, cr, uid, ids, context=None):
         config_parameters = self.pool.get("ir.config_parameter")
diff --git a/addons/mass_mailing/__openerp__.py b/addons/mass_mailing/__openerp__.py
index 91b57ac5b5a1f2424838e652eb73d345d1812c06..8b367439cf328502ded5d20f7a56552199a5a14c 100644
--- a/addons/mass_mailing/__openerp__.py
+++ b/addons/mass_mailing/__openerp__.py
@@ -48,6 +48,8 @@ professional emails and reuse templates in a few clicks.
         'views/res_config.xml',
         'views/res_partner.xml',
         'views/email_template.xml',
+        'views/website_mass_mailing.xml',
+        'views/snippets.xml',
         'security/ir.model.access.csv',
     ],
     'js': [
diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py
index 6a5f058cee5e576f6b769ca8752085d0490425d9..935b51c612c4d8ed6a44581c4cae5efe5ad17981 100644
--- a/addons/mass_mailing/controllers/main.py
+++ b/addons/mass_mailing/controllers/main.py
@@ -40,3 +40,35 @@ class MassMailController(http.Controller):
             if 'opt_out' in request.registry[mailing.mailing_model]._all_columns:
                 request.registry[mailing.mailing_model].write(cr, SUPERUSER_ID, record_ids, {'opt_out': True}, context=context)
         return 'OK'
+
+    @http.route(['/website_mass_mailing/is_subscriber'], type='json', auth="public", website=True)
+    def is_subscriber(self, list_id, **post):
+        cr, uid, context = request.cr, request.uid, request.context
+        Contacts = request.registry['mail.mass_mailing.contact']
+        Users = request.registry['res.users']
+
+        public_id = request.registry['website'].get_public_user(cr, uid, context)
+        is_subscriber = False
+        email = None
+        if uid != public_id:
+            email = Users.browse(cr, SUPERUSER_ID, uid, context).email
+        elif request.session.get('mass_mailing_email'):
+            email = request.session['mass_mailing_email']
+
+        if email:
+            contact_ids = Contacts.search(cr, SUPERUSER_ID, [('list_id', '=', int(list_id)), ('email', '=', email)], context=context)
+            is_subscriber = len(contact_ids) > 0
+
+        return {'is_subscriber': is_subscriber, 'email': email}
+
+    @http.route(['/website_mass_mailing/subscribe'], type='json', auth="public", website=True)
+    def subscribe(self, list_id, email, **post):
+        cr, uid, context = request.cr, request.uid, request.context
+        Contacts = request.registry['mail.mass_mailing.contact']
+
+        contact_ids = Contacts.search(cr, SUPERUSER_ID, [('list_id', '=', int(list_id)), ('email', '=', email)], context=context)
+        if not contact_ids:
+            Contacts.name_create(cr, SUPERUSER_ID, email, context=context)
+        # add email to session
+        request.session['mass_mailing_email'] = email
+        return True
diff --git a/addons/mass_mailing/data/mass_mailing_data.xml b/addons/mass_mailing/data/mass_mailing_data.xml
index 6bd1df79a7284fe3e94c8f6898075bcc5dd556b6..7137bfcf29bb96726d2fcbd37400bea78f30812a 100644
--- a/addons/mass_mailing/data/mass_mailing_data.xml
+++ b/addons/mass_mailing/data/mass_mailing_data.xml
@@ -33,5 +33,10 @@
             <field name="sequence">30</field>
         </record>
 
+        <!-- Create mailing lists -->
+        <record id="mass_mail_list_1" model="mail.mass_mailing.list">
+            <field name="name">Newsletter</field>
+        </record>
+
     </data>
 </openerp>
\ No newline at end of file
diff --git a/addons/mass_mailing/data/mass_mailing_demo.xml b/addons/mass_mailing/data/mass_mailing_demo.xml
index 569feec9c88d9720b4afeafc635e754751bca124..d5a84419f932217c8e97c6df0f93c7039b8b5e75 100644
--- a/addons/mass_mailing/data/mass_mailing_demo.xml
+++ b/addons/mass_mailing/data/mass_mailing_demo.xml
@@ -9,7 +9,7 @@
         </record>
 
         <!-- Create mailing lists -->
-        <record id="mass_mail_list_1" model="mail.mass_mailing.list">
+        <record id="mass_mail_list_2" model="mail.mass_mailing.list">
             <field name="name">Imported Contacts</field>
         </record>
 
@@ -17,17 +17,17 @@
         <record id="mass_mail_contact_1" model="mail.mass_mailing.contact">
             <field name="name">Aristide Antario</field>
             <field name="email">aa@example.com</field>
-            <field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
+            <field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
         </record>
         <record id="mass_mail_contact_2" model="mail.mass_mailing.contact">
             <field name="name">Beverly Bridge</field>
             <field name="email">bb@example.com</field>
-            <field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
+            <field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
         </record>
         <record id="mass_mail_contact_3" model="mail.mass_mailing.contact">
             <field name="name">Carol Cartridge</field>
             <field name="email">cc@example.com</field>
-            <field name="list_id" ref="mass_mailing.mass_mail_list_1"/>
+            <field name="list_id" ref="mass_mailing.mass_mail_list_2"/>
             <field name="opt_out" eval="True"/>
         </record>
 
diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py
index bd314f03a3d4b4b35e7c1d4ef97f0f14b95ae777..2e8a82a8f4d5dddb0f7e6df76a35ff556321d40e 100644
--- a/addons/mass_mailing/models/mass_mailing.py
+++ b/addons/mass_mailing/models/mass_mailing.py
@@ -271,9 +271,9 @@ class MassMailing(osv.Model):
             date_begin_str = date_begin.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
             date_end_str = date_end.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
             domain = [('mass_mailing_id', '=', mailing.id), ('opened', '>=', date_begin_str), ('opened', '<=', date_end_str)]
-            res[mailing.id]['opened_dayly'] = json.dumps(self.__get_bar_values(cr, uid, obj, domain, ['opened'], 'opened_count', 'opened:day', date_begin, context=context))
+            res[mailing.id]['opened_daily'] = json.dumps(self.__get_bar_values(cr, uid, obj, domain, ['opened'], 'opened_count', 'opened:day', date_begin, context=context))
             domain = [('mass_mailing_id', '=', mailing.id), ('replied', '>=', date_begin_str), ('replied', '<=', date_end_str)]
-            res[mailing.id]['replied_dayly'] = json.dumps(self.__get_bar_values(cr, uid, obj, domain, ['replied'], 'replied_count', 'replied:day', date_begin, context=context))
+            res[mailing.id]['replied_daily'] = json.dumps(self.__get_bar_values(cr, uid, obj, domain, ['replied'], 'replied_count', 'replied:day', date_begin, context=context))
         return res
 
     def _get_statistics(self, cr, uid, ids, name, arg, context=None):
@@ -314,7 +314,7 @@ class MassMailing(osv.Model):
         'name': fields.char('Subject', required=True),
         'email_from': fields.char('From', required=True),
         'create_date': fields.datetime('Creation Date'),
-        'sent_date': fields.datetime('Sent Date'),
+        'sent_date': fields.datetime('Sent Date', oldname='date'),
         'body_html': fields.html('Body'),
         'attachment_ids': fields.many2many(
             'ir.attachment', 'mass_mailing_ir_attachments_rel',
@@ -340,7 +340,7 @@ class MassMailing(osv.Model):
         'reply_to': fields.char('Reply To', help='Preferred Reply-To Address'),
         # recipients
         'mailing_model': fields.selection(_mailing_model, string='Recipients Model', required=True),
-        'mailing_domain': fields.char('Domain'),
+        'mailing_domain': fields.char('Domain', oldname='domain'),
         'contact_list_ids': fields.many2many(
             'mail.mass_mailing.list', 'mail_mass_mailing_list_rel',
             string='Mailing Lists',
@@ -398,16 +398,14 @@ class MassMailing(osv.Model):
             _get_statistics, string='Replied Ratio',
             type='integer', multi='_get_statistics',
         ),
-        # dayly ratio
-        'opened_dayly': fields.function(
+        # daily ratio
+        'opened_daily': fields.function(
             _get_daily_statistics, string='Opened',
             type='char', multi='_get_daily_statistics',
-            oldname='opened_monthly',
         ),
-        'replied_dayly': fields.function(
+        'replied_daily': fields.function(
             _get_daily_statistics, string='Replied',
             type='char', multi='_get_daily_statistics',
-            oldname='replied_monthly',
         )
     }
 
diff --git a/addons/mass_mailing/models/mass_mailing_stats.py b/addons/mass_mailing/models/mass_mailing_stats.py
index 319a6fde14d92f7551a9bc3112ca862481145f16..7e8c194f42e567a0777080e4361fd3288a5c3662 100644
--- a/addons/mass_mailing/models/mass_mailing_stats.py
+++ b/addons/mass_mailing/models/mass_mailing_stats.py
@@ -19,23 +19,8 @@
 #
 ##############################################################################
 
-from datetime import datetime
-from dateutil import relativedelta
-import random
-try:
-    import simplejson as json
-except ImportError:
-    import json
-import urllib
-import urlparse
-
-from openerp import tools
-from openerp.exceptions import Warning
-from openerp.tools.safe_eval import safe_eval as eval
-from openerp.tools.translate import _
 from openerp.osv import osv, fields
 
-
 class MailMailStats(osv.Model):
     """ MailMailStats models the statistics collected about emails. Those statistics
     are stored in a separated model and table to avoid bloating the mail_mail table
@@ -48,11 +33,7 @@ class MailMailStats(osv.Model):
     _order = 'message_id'
 
     _columns = {
-        'mail_mail_id': fields.integer(
-            'Mail ID',
-            help='ID of the related mail_mail. This field is an integer field because'
-                 'the related mail_mail can be deleted separately from its statistics.'
-        ),
+        'mail_mail_id': fields.many2one('mail.mail', 'Mail ID', ondelete='set null'),
         'message_id': fields.char('Message-ID'),
         'model': fields.char('Document model'),
         'res_id': fields.integer('Document ID'),
@@ -106,4 +87,3 @@ class MailMailStats(osv.Model):
         stat_ids = self._get_ids(cr, uid, ids, mail_mail_ids, mail_message_ids, [('bounced', '=', False)], context)
         self.write(cr, uid, stat_ids, {'bounced': fields.datetime.now()}, context=context)
         return stat_ids
-
diff --git a/addons/mass_mailing/static/src/img/blocks/button_newsletter.png b/addons/mass_mailing/static/src/img/blocks/button_newsletter.png
new file mode 100644
index 0000000000000000000000000000000000000000..46a63ef9b0021b83e9c25c575f2cb621e09c39e1
Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/button_newsletter.png differ
diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js
new file mode 100644
index 0000000000000000000000000000000000000000..4caba1d29b521f302785c45f31cf2d305eaa151f
--- /dev/null
+++ b/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js
@@ -0,0 +1,40 @@
+(function () {
+    'use strict';
+
+    var website = openerp.website;
+    var _t = openerp._t;
+
+    website.snippet.options.mailing_list_subscribe = website.snippet.Option.extend({
+        on_prompt: function () {
+            var self = this;
+            return website.prompt({
+                id: "editor_new_mailing_list_subscribe_button",
+                window_title: _t("Add a Newsletter Subscribe Button"),
+                select: _t("Newsletter"),
+                init: function (field) {
+                    return website.session.model('mail.mass_mailing.list')
+                            .call('name_search', ['', []], { context: website.get_context() });
+                },
+            }).then(function (mailing_list_id) {
+                self.$target.attr("data-list-id", mailing_list_id);
+            });
+        },
+        drop_and_build_snippet: function() {
+            var self = this;
+            this._super();
+            this.on_prompt().fail(function () {
+                self.editor.on_remove();
+            });
+        },
+        start : function () {
+            var self = this;
+            this.$el.find(".js_mailing_list").on("click", _.bind(this.on_prompt, this));
+            this._super();
+        },
+        clean_for_save: function () {
+            this.$target.addClass("hidden");
+        },
+    });
+})();
+
+
diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.js b/addons/mass_mailing/static/src/js/website_mass_mailing.js
new file mode 100644
index 0000000000000000000000000000000000000000..5776fadfb3f39a6f28ca9beeebf8526e6b774757
--- /dev/null
+++ b/addons/mass_mailing/static/src/js/website_mass_mailing.js
@@ -0,0 +1,57 @@
+(function () {
+    'use strict';
+
+    var website = openerp.website;
+
+    website.snippet.animationRegistry.subscribe = website.snippet.Animation.extend({
+        selector: ".js_subscribe",
+        start: function (editable_mode) {
+            var self = this;
+
+            // set value and display button
+            self.$target.find("input").removeClass("hidden");
+            openerp.jsonRpc('/website_mass_mailing/is_subscriber', 'call', {
+                list_id: this.$target.data('list-id'),
+            }).always(function (data) {
+                self.$target.find('input.js_subscribe_email')
+                    .val(data.email ? data.email : "")
+                    .attr("disabled", data.is_subscriber && data.email.length ? "disabled" : false);
+                self.$target.attr("data-subscribe", data.is_subscriber ? 'on' : 'off');
+                self.$target.find('a.js_subscribe_btn')
+                    .val(data.email ? data.email : "")
+                    .attr("disabled", data.is_subscriber && data.email.length ? "disabled" : false);
+                self.$target.removeClass("hidden");
+            });
+
+            // not if editable mode to allow designer to edit alert field
+            if (!editable_mode) {
+                $('.js_subscribe > .alert').addClass("hidden");
+                $('.js_subscribe > .input-group-btn.hidden').removeClass("hidden");
+                this.$target.find('.js_subscribe_btn').on('click', function (event) {
+                    event.preventDefault();
+                    self.on_click();
+                });
+            }
+        },
+        on_click: function () {
+            var self = this;
+            var $email = this.$target.find(".js_subscribe_email:visible");
+
+            if ($email.length && !$email.val().match(/.+@.+/)) {
+                this.$target.addClass('has-error');
+                return false;
+            }
+            this.$target.removeClass('has-error');
+
+            openerp.jsonRpc('/website_mass_mailing/subscribe', 'call', {
+                'list_id': this.$target.data('list-id'),
+                'email': $email.length ? $email.val() : false,
+            }).then(function (subscribe) {
+                self.$target.find(".js_subscribe_email, .input-group-btn").addClass("hidden");
+                self.$target.find(".alert").removeClass("hidden");
+                self.$target.find('input.js_subscribe_email').attr("disabled", subscribe ? "disabled" : false);
+                self.$target.attr("data-subscribe", subscribe ? 'on' : 'off');
+            });
+        },
+    });
+})();
diff --git a/addons/mass_mailing/views/mass_mailing.xml b/addons/mass_mailing/views/mass_mailing.xml
index 7892feacaccd48ec7a3a5ac6801437cbb359dadf..a1d0241ea4f6d268c24c21f276e6dbdcdb03edeb 100644
--- a/addons/mass_mailing/views/mass_mailing.xml
+++ b/addons/mass_mailing/views/mass_mailing.xml
@@ -208,11 +208,11 @@
                             </button>
                             <button name="%(action_view_mass_mailing_contacts)d"
                                 type="action" class="oe_stat_button oe_inline">
-                                <field name="opened_dayly" string="Opened Daily" widget="barchart"/>
+                                <field name="opened_daily" string="Opened Daily" widget="barchart"/>
                             </button>
                             <button name="%(action_view_mass_mailing_contacts)d"
                                 type="action" class="oe_stat_button oe_inline">
-                                <field name="replied_dayly" string="Replied Daily" widget="barchart"/>
+                                <field name="replied_daily" string="Replied Daily" widget="barchart"/>
                             </button>
                         </div>
                         <div class="oe_button_box" attrs="{'invisible': [('total', '=', 0)]}" style="margin-bottom: 32px">
diff --git a/addons/mass_mailing/views/snippets.xml b/addons/mass_mailing/views/snippets.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cefe2e7bdfd322f6210cf943a03baf8fd13ba749
--- /dev/null
+++ b/addons/mass_mailing/views/snippets.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+<template id="mailing_list_subscribe" inherit_id="website.snippets" name="Subscribe to Newsletter">
+
+    <xpath expr="//div[@id='snippet_content']" position="inside">
+        <div>
+            <div class="oe_snippet_thumbnail">
+                <img class="oe_snippet_thumbnail_img" src="/mass_mailing/static/src/img/blocks/button_newsletter.png"/>
+                <span class="oe_snippet_thumbnail_title">Newsletter</span>
+            </div>
+
+            <div class="oe_snippet_body input-group js_subscribe"
+                      data-list-id="0">
+                <input
+                      type="email"
+                      name="email"
+                      class="js_subscribe_email form-control"
+                      placeholder="your email..."/>
+                <span class="input-group-btn">
+                    <a href="#" class="btn btn-primary js_subscribe_btn">Subscribe</a>
+                </span>
+                <div class="alert alert-success hidden">Thanks for your subscription!</div>
+            </div>
+
+        </div>
+    </xpath>
+
+    <xpath expr="//div[@id='snippet_options']" position="inside">
+        <div data-snippet-option-id='mailing_list_subscribe'
+            data-selector=".js_subscribe"
+            data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
+           >
+            <li>
+                <a href="#" class="button js_mailing_list">Change Newsletter</a>
+            </li>
+        </div>
+    </xpath>
+
+</template>
+
+</data>
+</openerp>
diff --git a/addons/mass_mailing/views/website_mass_mailing.xml b/addons/mass_mailing/views/website_mass_mailing.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bc55f61400c3adcd277da28bc95831250c4b9597
--- /dev/null
+++ b/addons/mass_mailing/views/website_mass_mailing.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+<template id="head" inherit_id="website.layout" name="Mail customization">
+    <xpath expr="//head" position="inside">
+        <script type="text/javascript" src="/mass_mailing/static/src/js/website_mass_mailing.editor.js" groups="base.group_website_publisher"></script>
+        <script type="text/javascript" src="/mass_mailing/static/src/js/website_mass_mailing.js"></script>
+        <link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/>
+    </xpath>
+</template>
+
+</data>
+</openerp>
diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml
index 44a021c1434f5e607121adf4f319f69e5f7c0258..d7d1af24f07b6b04ddf92345be853d9ef9826083 100644
--- a/addons/multi_company/multi_company_demo.xml
+++ b/addons/multi_company/multi_company_demo.xml
@@ -59,7 +59,7 @@
         <record id="res_company_oerp_us" model="res.company">
             <field name="partner_id" ref="res_partner_oerp_us"/>
             <field name="parent_id" ref="res_company_oerp_editor"/>
-            <field name="currency_id" ref="base.EUR"/>
+            <field name="currency_id" ref="base.USD"/>
             <field name="name">OpenERP US</field>
         </record>
         <record id="res_company_oerp_be" model="res.company">
@@ -400,7 +400,7 @@
         </record>
         <record id="project.project_project_3" model="project.project">
         <field name="company_id" ref="res_company_oerp_us"/>
-        <field name="currency_id" ref="base.EUR"/>
+        <field name="currency_id" ref="base.USD"/>
         </record>
         <record id="project.project_project_4" model="project.project">
         <field name="company_id" ref="res_company_oerp_be"/>
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index f18edf39e85afbfe2c8b7d0297a50aa48e56e0c0..f188af8aa824bed9fe32d67e7b6ae17b48678965 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -1167,8 +1167,8 @@ class pos_order(osv.osv):
         return self.write(cr, uid, ids, {'state': 'payment'}, context=context)
 
     def action_paid(self, cr, uid, ids, context=None):
-        self.create_picking(cr, uid, ids, context=context)
         self.write(cr, uid, ids, {'state': 'paid'}, context=context)
+        self.create_picking(cr, uid, ids, context=context)
         return True
 
     def action_cancel(self, cr, uid, ids, context=None):
diff --git a/addons/product/product.py b/addons/product/product.py
index eed8859bd945cc628e9163324f58344ccf369145..523aae8b076eb28fde9a83073aaf1403494ce57c 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -805,9 +805,17 @@ class product_product(osv.osv):
             price_type_currency_id = pricetype_obj.browse(cr,uid,price_type_id).currency_id.id
 
         res = {}
+        # standard_price field can only be seen by users in base.group_user
+        # Thus, in order to compute the sale price from the cost price for users not in this group
+        # We fetch the standard price as the superuser
+        for product in products:
+            if ptype != 'standard_price':
+                res[product.id] = product[ptype] or 0.0
+            else: 
+                res[product.id] = self.read(cr, SUPERUSER_ID, product.id, [ptype], context=context)[ptype] or 0.0
+
         product_uom_obj = self.pool.get('product.uom')
         for product in products:
-            res[product.id] = product[ptype] or 0.0
             if ptype == 'list_price':
                 res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \
                         product.price_extra
diff --git a/addons/report/models/report.py b/addons/report/models/report.py
index 8dd8a4dce6ff7e6d6fcea574c93c4b09a607cd5e..fed6a2335eed0cab0a2c7c7efc265fef9be5d05a 100644
--- a/addons/report/models/report.py
+++ b/addons/report/models/report.py
@@ -260,11 +260,17 @@ class Report(osv.Model):
     def get_action(self, cr, uid, ids, report_name, data=None, context=None):
         """Return an action of type ir.actions.report.xml.
 
+        :param ids: Ids of the records to print (if not used, pass an empty list)
         :param report_name: Name of the template to generate an action for
         """
         if context is None:
             context = {}
 
+        if ids:
+            if not isinstance(ids, list):
+                ids = [ids]
+            context['active_ids'] = ids
+
         report_obj = self.pool['ir.actions.report.xml']
         idreport = report_obj.search(cr, uid, [('report_name', '=', report_name)], context=context)
         try:
@@ -272,7 +278,7 @@ class Report(osv.Model):
         except IndexError:
             raise osv.except_osv(_('Bad Report'), _('This report is not loaded into the database.'))
 
-        action = {
+        return {
             'context': context,
             'data': data,
             'type': 'ir.actions.report.xml',
@@ -280,7 +286,6 @@ class Report(osv.Model):
             'report_type': report.report_type,
             'report_file': report.report_file,
         }
-        return action
 
     #--------------------------------------------------------------------------
     # Report generation helpers
diff --git a/addons/report_webkit/__openerp__.py b/addons/report_webkit/__openerp__.py
index 9440743057a7e6cae8499e5dfa78a22da108da31..b8557e7747ef39ba943898ae6a3b2ec03966ebd9 100644
--- a/addons/report_webkit/__openerp__.py
+++ b/addons/report_webkit/__openerp__.py
@@ -79,7 +79,7 @@ TODO:
     * Web client WYSIWYG
 """,
     'version': '0.9',
-    'depends': ['base'],
+    'depends': ['base','report'],
     'author': 'Camptocamp',
     'category': 'Reporting', # i.e a technical module, not shown in Application install menu
     'url': 'http://http://www.camptocamp.com/',
diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py
index f90aecac184d0ea283eec110e043ada5bbf9e46a..9b7726c63a1a773d005c3d76033a08bb58fd894b 100644
--- a/addons/sale_stock/sale_stock.py
+++ b/addons/sale_stock/sale_stock.py
@@ -356,7 +356,6 @@ class sale_order(osv.osv):
         }
 
     def ship_recreate(self, cr, uid, order, line, move_id, proc_id):
-        # FIXME: deals with potentially cancelled shipments, seems broken (specially if shipment has production lot)
         """
         Define ship_recreate for process after shipping exception
         param order: sales order to which the order lines belong
@@ -365,16 +364,25 @@ class sale_order(osv.osv):
         param proc_id: the ID of procurement
         """
         move_obj = self.pool.get('stock.move')
-        if order.state == 'shipping_except':
-            for pick in order.picking_ids:
-                for move in pick.move_lines:
-                    if move.state == 'cancel':
-                        mov_ids = move_obj.search(cr, uid, [('state', '=', 'cancel'),('sale_line_id', '=', line.id),('picking_id', '=', pick.id)])
-                        if mov_ids:
-                            for mov in move_obj.browse(cr, uid, mov_ids):
-                                # FIXME: the following seems broken: what if move_id doesn't exist? What if there are several mov_ids? Shouldn't that be a sum?
-                                move_obj.write(cr, uid, [move_id], {'product_qty': mov.product_qty, 'product_uos_qty': mov.product_uos_qty})
-                                self.pool.get('procurement.order').write(cr, uid, [proc_id], {'product_qty': mov.product_qty, 'product_uos_qty': mov.product_uos_qty})
+        proc_obj = self.pool.get('procurement.order')
+        if move_id and order.state == 'shipping_except':
+            current_move = move_obj.browse(cr, uid, move_id)
+            moves = []
+            for picking in order.picking_ids:
+                if picking.id != current_move.picking_id.id and picking.state != 'cancel':
+                    moves.extend(move for move in picking.move_lines if move.state != 'cancel' and move.sale_line_id.id == line.id)
+            if moves:
+                product_qty = current_move.product_qty
+                product_uos_qty = current_move.product_uos_qty
+                for move in moves:
+                    product_qty -= move.product_qty
+                    product_uos_qty -= move.product_uos_qty
+                if product_qty > 0 or product_uos_qty > 0:
+                    move_obj.write(cr, uid, [move_id], {'product_qty': product_qty, 'product_uos_qty': product_uos_qty})
+                    proc_obj.write(cr, uid, [proc_id], {'product_qty': product_qty, 'product_uos_qty': product_uos_qty})
+                else:
+                    current_move.unlink()
+                    proc_obj.unlink(cr, uid, [proc_id])
         return True
 
     def _get_date_planned(self, cr, uid, order, line, start_date, context=None):
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 3eddf0a1c729d4699d9d5fd8a322c40e0b2b6613..1cd93225d45463221ec394781ec663dcca4046a2 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -105,7 +105,9 @@ class product_product(osv.osv):
                     'compute_child': False
                 })
 
-                qty = product.qty_available
+                # qty_available depends of the location in the context
+                qty = self.read(cr, uid, [product.id], ['qty_available'], context=c)[0]['qty_available']
+
                 diff = product.standard_price - new_price
                 if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!"))
                 if qty:
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 5276e7f21e5aa83e06131fecdbc5fd0844d2a4fa..efb8582e9cb1bc8c934bea8b62df011cc0adadf4 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -2307,7 +2307,9 @@ class stock_move(osv.osv):
 
         # if product is set to average price and a specific value was entered in the picking wizard,
         # we use it
-        if move.product_id.cost_method == 'average' and move.price_unit:
+        if move.location_dest_id.usage != 'internal' and move.product_id.cost_method == 'average':
+            reference_amount = qty * move.product_id.standard_price
+        elif move.product_id.cost_method == 'average' and move.price_unit:
             reference_amount = qty * move.price_unit
             reference_currency_id = move.price_currency_id.id or reference_currency_id
 
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index e96652c11aab805a4d499482888c6d437928ad0b..dba3225e76017e685b0e8168c21f9576fa59679a 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -792,7 +792,7 @@
                     </group>
                     <notebook>
                         <page string="Products">
-                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'picking_type': 'internal'}" options='{"reload_on_button": true}'/>
+                            <field name="move_lines" string="Stock Move" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'picking_type': 'internal'}" options='{"reload_on_button": true}'/>
                             <field name="note" placeholder="Add an internal note..." class="oe_inline"/>
                         </page>
                         <page string="Additional Info">
@@ -926,7 +926,7 @@
                     <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Customer" domain="[('customer','=',True)]" />
                 </xpath>
                 <xpath expr="//field[@name='move_lines']" position="replace">
-                    <field name="move_lines" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
+                    <field name="move_lines" string="Stock Move" context="{'address_out_id': partner_id, 'picking_type': 'out', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
                 </xpath>
                 <xpath expr="/form/sheet" position="after">
                     <div class="oe_chatter">
@@ -1053,7 +1053,7 @@
                     <field name="partner_id" on_change="onchange_partner_in(partner_id)" string="Supplier" domain="[('supplier','=',True)]" context="{'default_supplier':1,'default_customer':0}"/>
                 </xpath>
                 <xpath expr="//field[@name='move_lines']" position="replace">
-                    <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
+                    <field name="move_lines" string="Stock Move" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree'}" options='{"reload_on_button": true}'/>
                 </xpath>
                 <xpath expr="/form/sheet" position="after">
                     <div class="oe_chatter">
@@ -1271,7 +1271,7 @@
                             <field name="date" attrs="{'invisible': [('state', '!=', 'done')]}"/>
                         </group>
                         <group string="Traceability"
-                            groups="stock.group_tracking_lot">
+                            groups="stock.group_tracking_lot,stock.group_production_lot">
                             <label for="tracking_id" groups="stock.group_tracking_lot"/>
                             <div groups="stock.group_tracking_lot">
                                 <field name="tracking_id" class="oe_inline"/>
@@ -1340,7 +1340,7 @@
 
                             <group string="Locations" groups="stock.group_locations">
                                 <field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
-                                <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
+                                <field name="location_dest_id" domain="[('usage','in', ['internal', 'supplier', 'customer'])]" groups="stock.group_locations"/>
                             </group>
 
                             <group groups="stock.group_tracking_lot" string="Traceability">
diff --git a/addons/warning/warning.py b/addons/warning/warning.py
index d582478113a5c43c5a752597ad28a1a85a838927..539316482d246ae23f010441f072c236caf9631f 100644
--- a/addons/warning/warning.py
+++ b/addons/warning/warning.py
@@ -62,14 +62,14 @@ class sale_order(osv.osv):
         message = False
         partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
         if partner.sale_warn != 'no-message':
-            if partner.sale_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.sale_warn_msg)
             title =  _("Warning for %s") % partner.name
             message = partner.sale_warn_msg
             warning = {
                     'title': title,
                     'message': message,
             }
+            if partner.sale_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
 
         result =  super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
 
@@ -90,14 +90,15 @@ class purchase_order(osv.osv):
         message = False
         partner = self.pool.get('res.partner').browse(cr, uid, part)
         if partner.purchase_warn != 'no-message':
-            if partner.purchase_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.purchase_warn_msg)
             title = _("Warning for %s") % partner.name
             message = partner.purchase_warn_msg
             warning = {
                 'title': title,
                 'message': message
                 }
+            if partner.purchase_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
+
         result =  super(purchase_order, self).onchange_partner_id(cr, uid, ids, part)
 
         if result.get('warning',False):
@@ -123,15 +124,16 @@ class account_invoice(osv.osv):
         message = False
         partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
         if partner.invoice_warn != 'no-message':
-            if partner.invoice_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.invoice_warn_msg)
-
             title = _("Warning for %s") % partner.name
             message = partner.invoice_warn_msg
             warning = {
                 'title': title,
                 'message': message
                 }
+
+            if partner.invoice_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
+
         result =  super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id,
             date_invoice=date_invoice, payment_term=payment_term, 
             partner_bank_id=partner_bank_id, company_id=company_id)
@@ -154,14 +156,15 @@ class stock_picking(osv.osv):
         title = False
         message = False
         if partner.picking_warn != 'no-message':
-            if partner.picking_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
             title = _("Warning for %s") % partner.name
             message = partner.picking_warn_msg
             warning = {
                 'title': title,
                 'message': message
             }
+            if partner.picking_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
+
         result =  super(stock_picking, self).onchange_partner_in(cr, uid, ids, partner_id, context)
         if result.get('warning',False):
             warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
@@ -183,14 +186,15 @@ class stock_picking_in(osv.osv):
         title = False
         message = False
         if partner.picking_warn != 'no-message':
-            if partner.picking_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
             title = _("Warning for %s") % partner.name
             message = partner.picking_warn_msg
             warning = {
                 'title': title,
                 'message': message
             }
+            if partner.picking_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
+
         result =  super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context)
         if result.get('warning',False):
             warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
@@ -209,14 +213,15 @@ class stock_picking_out(osv.osv):
         title = False
         message = False
         if partner.picking_warn != 'no-message':
-            if partner.picking_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
             title = _("Warning for %s") % partner.name
             message = partner.picking_warn_msg
             warning = {
                 'title': title,
                 'message': message
             }
+            if partner.picking_warn == 'block':
+                return {'value': {'partner_id': False}, 'warning': warning}
+
         result =  super(stock_picking_out, self).onchange_partner_in(cr, uid, ids, partner_id, context)
         if result.get('warning',False):
             warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
@@ -256,12 +261,12 @@ class sale_order_line(osv.osv):
         message = False
 
         if product_info.sale_line_warn != 'no-message':
-            if product_info.sale_line_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.sale_line_warn_msg)
             title = _("Warning for %s") % product_info.name
             message = product_info.sale_line_warn_msg
             warning['title'] = title
             warning['message'] = message
+            if product_info.sale_line_warn == 'block':
+                return {'value': {'product_id': False}, 'warning': warning}
 
         result =  super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty,
             uom, qty_uos, uos, name, partner_id,
@@ -288,12 +293,12 @@ class purchase_order_line(osv.osv):
         message = False
 
         if product_info.purchase_line_warn != 'no-message':
-            if product_info.purchase_line_warn == 'block':
-                raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.purchase_line_warn_msg)
             title = _("Warning for %s") % product_info.name
             message = product_info.purchase_line_warn_msg
             warning['title'] = title
             warning['message'] = message
+            if product_info.purchase_line_warn == 'block':
+                return {'value': {'product_id': False}, 'warning': warning}
 
         result =  super(purchase_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product, qty, uom,
             partner_id, date_order, fiscal_position_id)
diff --git a/addons/website/security/ir.model.access.csv b/addons/website/security/ir.model.access.csv
index 694ab83e1bdff5452ca3331aefc1d18c9488304e..8682a349f7025727ecb8ae31b9546ff12185aa75 100644
--- a/addons/website/security/ir.model.access.csv
+++ b/addons/website/security/ir.model.access.csv
@@ -1,9 +1,12 @@
 id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
 access_website_public,website,website.model_website,,1,0,0,0
-access_website,website,website.model_website,base.group_user,1,0,0,0
+access_website,website,website.model_website,base.group_website_designer,1,1,1,1
 access_website_menu,access_website_menu,model_website_menu,,1,0,0,0
+access_website_menu_designer,Web Menu Manager,model_website_menu,base.group_website_designer,1,1,1,1
+access_website,web menu manager,website.model_website,base.group_website_designer,1,1,1,1
 access_website_converter_test,access_website_converter_test,model_website_converter_test,,1,1,1,1
 access_website_converter_test_sub,access_website_converter_test_sub,model_website_converter_test_sub,,1,1,1,1
 access_website_ir_ui_view,access_website_ir_ui_view,model_ir_ui_view,base.group_website_designer,1,1,1,1
 access_seo_public,access_seo_public,model_website_seo_metadata,,1,0,0,0
+access_seo_public,access_seo_manager,model_website_seo_metadata,base.group_website_designer,1,1,1,1
 access_seo_designer,access_seo_designer,model_website_seo_metadata,base.group_website_designer,1,1,1,1
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 2119d05f6503537001e8c53fb1fa1dffe73adead..d7b7843de00c6c0559a9cd9f45243618897d501d 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -1056,6 +1056,7 @@
             this.trigger("saved");
         },
         cancel: function () {
+            this.trigger("cancel");
         },
         close: function () {
             this.$el.modal('hide');
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index bae014029e18d0295e5ab8dfea91b36d53d1fb8b..51e8bc3b991c2430e6799059a2c221de3b404d3e 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -362,7 +362,7 @@
         },
         clean_for_save: function () {
             var self = this;
-            $(website.snippet.globalSelector).each(function () {
+            this.dom_filter(website.snippet.globalSelector).each(function () {
                 var $snippet = $(this);
                 self.make_active($snippet);
                 self.make_active(false);
@@ -875,20 +875,29 @@
             this._super(np);
             if (np.$next) {
                 if (np.$next.hasClass("oe_custom_bg")) {
-                    var editor = new website.editor.ImageDialog();
-                    editor.on('start', self, function (o) {o.url = np.$prev && np.$prev.data("src") || np.$next && np.$next.data("src") || "";});
-                    editor.on('save', self, function (o) {
-                        self._set_bg(o.url);
-                        np.$next.data("src", o.url);
+                    var $image = $('<img class="hidden"/>');
+                    $image.attr("src", np.$prev ? np.$prev.data("src") : '');
+                    $image.appendTo(self.$target);
+
+                    self.element = new CKEDITOR.dom.element($image[0]);
+                    var editor = new website.editor.MediaDialog(self, self.element);
+                    editor.appendTo(document.body);
+                    editor.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden');
+
+                    $image.on('saved', self, function (o) {
+                        var src = $image.attr("src");
+                        self._set_bg(src);
+                        np.$next.data("src", src);
                         self.$target.trigger("snippet-style-change", [self, np]);
+                        $image.remove();
                     });
                     editor.on('cancel', self, function () {
                         if (!np.$prev || np.$prev.data("src") === "") {
                             self.$target.removeClass(np.$next.data("value"));
                             self.$target.trigger("snippet-style-change", [self, np]);
                         }
+                        $image.remove();
                     });
-                    editor.appendTo($('body'));
                 } else {
                     this._set_bg(np.$next.data("src"));
                 }
diff --git a/addons/website_blog/static/description/index.html b/addons/website_blog/static/description/index.html
index 171fe942843186f3d2beec5f6ff31cc81f575f74..6a1f940e4053f9fbcf1af08cbca820d0b3874b98 100644
--- a/addons/website_blog/static/description/index.html
+++ b/addons/website_blog/static/description/index.html
@@ -51,7 +51,7 @@
 <section class="oe_container">
     <div class="oe_row">
         <h2 class="oe_slogan">Automated Translation by Professionals</h2>
-        <h3 class="oe_slogan">Reach multi-languages audiences without Pain</h3>
+        <h3 class="oe_slogan">Reach multi-language audiences without pain</h3>
         <div class="oe_span6">
             <div class="oe_bg_img">
                 <img class="oe_picture" src="openerp_translation_tool.png">
@@ -75,7 +75,7 @@
         <h3 class="oe_slogan">Live chat with your visitors in one click</h3>
         <div class="oe_span6">
           <p class='oe_mt32'>
-              The integrated live chat features allows you to start chatting in
+              The integrated live chat feature allows you to start chatting in
               real time with your visitors to get feedback on your recent posts
               or get ideas to write new posts.
           </p><p>
@@ -93,7 +93,7 @@
 
 <section class="oe_container">
     <div class="oe_row">
-        <h2 class="oe_slogan">Build Visitors Loyalty</h2>
+        <h2 class="oe_slogan">Build Visitor Loyalty</h2>
         <h3 class="oe_slogan">Social Media Integration and Easy Following</h3>
         <div class="oe_span6">
             <img class="oe_picture oe_screenshot" src="social.png">
@@ -102,7 +102,7 @@
            <p class='oe_mt32'>
                 The one click <em>follow</em> button will allow visitors
                 to receive your blog posts by email with no effort, without
-                having to register. Social media icons allows visitors to share
+                having to register. Social media icons allow visitors to share
                 your best blog posts easily.
            </p>
         </div>
@@ -116,7 +116,7 @@
         <div class="oe_span6">
           <p class='oe_mt32'>
             Get a clear visibility of your sales funnel. OpenERP's Google
-            Analytics trackers are configured by default to track all kind of
+            Analytics trackers are configured by default to track all kinds of
             events related to shopping carts, call-to-actions, etc.
           </p><p>
             As OpenERP marketing tools (mass mailing, campaigns, etc) are also
@@ -141,13 +141,13 @@
         <div class="oe_span6">
           <p class='oe_mt32'>
               SEO tools are ready to use, with no configuration required.
-              OpenERP suggests keywords for your titles according to Google
-              most searched terms, Google Analytics tracks interrests of your
-              visitors, sitemap are created automatically for Google
-              indexation, etc.
+              OpenERP suggests keywords for your titles according to Google's
+              most searched terms, Google Analytics tracks interests of your
+              visitors, sitemaps are created automatically for quick Google
+              indexing, etc.
           </p><p>
-              We even do structured content automatically to promote your
-              product and events efficiently in Google.
+              The system even creates structured content automatically to promote your
+              products and events effectively in Google.
           </p>
         </div>
     </div>
@@ -162,10 +162,10 @@
               Themes are awesome and easy to design. You don't need to develop
               to create new pages, themes or building blocks. We use a clean
               HTML structure, a <a href="http://getbootstrap.com/">bootstrap</a>
-              CSS and our modularity allows to distribute your themes easily.
+              CSS and our modularity allows you to distribute your themes easily.
           </p><p>
               The building block approach allows the website to remain clean
-              after the end-users start creating new contents.
+              after end-users start creating new contents.
           </p>
         </div>
         <div class="oe_span6">
@@ -178,7 +178,7 @@
 <section class="oe_container">
     <div class="oe_row">
         <h2 class="oe_slogan">Easy Access Rights</h2>
-        <h3 class="oe_slogan">Adapt your publishing process to your own need</h3>
+        <h3 class="oe_slogan">A publishing process that meets your own needs</h3>
         <div class="oe_span6">
             <div class="oe_bg_img">
                 <img class="oe_picture oe_screenshot" src="blog_create.png">
@@ -187,13 +187,13 @@
         <div class="oe_span6">
           <p class='oe_mt32'>
               Not everyone requires the same access to your website.
-              Designers manage the layout of the site, editors approves content and
+              Designers manage the layout of the site, editors approve content and
               authors write that content. This lets you organize your publishing
               process according to your needs.
           </p><p>
-              Others access rights related to business objects (products, people,
-              events, etc) directly follows OpenERP's standard access right allowing
-              you to not have to configure them twice.
+              Other access rights are related to business objects (products, people,
+              events, etc) and directly following OpenERP's standard access rights
+              management, so you do not have to configure things twice.
           </p>
         </div>
     </div>
diff --git a/addons/website_event/views/website_event.xml b/addons/website_event/views/website_event.xml
index 1b3ce09fca66f30d605f14d1d02fef6fef9c5269..884670b7d2c8d4161f2b5207c45e2a2ba5f9c2df 100644
--- a/addons/website_event/views/website_event.xml
+++ b/addons/website_event/views/website_event.xml
@@ -381,7 +381,7 @@
         </div>
     </xpath>
     <xpath expr="//div[@id='snippet_options']" position="inside">
-        <div data-snippet-option-id='content'
+        <div data-snippet-option-id='country_events'
             data-selector=".oe_country_events"
             data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
             data-selector-children=".content"
diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py
index d4ea6b58d5d930417f12eeeb51a6dbc544cb5f49..066fd98fc8a6d9a83a096a61cf7809c2ce7b5e33 100644
--- a/addons/website_event_sale/models/sale_order.py
+++ b/addons/website_event_sale/models/sale_order.py
@@ -7,15 +7,15 @@ from openerp.addons.web.http import request
 class sale_order_line(osv.osv):
     _inherit = "sale.order.line"
 
-    def _recalculate_product_values(self, cr, uid, ids, product_id=0, context=None):
+    def _recalculate_product_values(self, cr, uid, ids, product_id=0, fiscal_position=False, context=None):
         if not ids:
-            return super(sale_order_line, self)._recalculate_product_values(cr, uid, ids, product_id, context=context)
+            return super(sale_order_line, self)._recalculate_product_values(cr, uid, ids, product_id, fiscal_position=fiscal_position, context=context)
 
         order_line = self.browse(cr, SUPERUSER_ID, ids[0], context=context)
         assert order_line.order_id.website_session_id == request.session['website_session_id']
 
         product = product_id and self.pool.get('product.product').browse(cr, uid, product_id, context=context) or order_line.product_id
-        res = super(sale_order_line, self)._recalculate_product_values(cr, uid, ids, product.id, context=context)
+        res = super(sale_order_line, self)._recalculate_product_values(cr, uid, ids, product.id, fiscal_position=fiscal_position, context=context)
         if product.event_type_id and order_line.event_ticket_id and order_line.event_ticket_id.price != product.lst_price:
             res.update({'price_unit': order_line.event_ticket_id.price})
 
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py
index 365221f9574c381c51cdf658627251b5b4f3a6e2..cd36a8024224d3d896eb076ab346d64f84b36eb1 100644
--- a/addons/website_forum/controllers/main.py
+++ b/addons/website_forum/controllers/main.py
@@ -124,6 +124,7 @@ class WebsiteForum(http.Controller):
         values.update({
             'main_object': tag or forum,
             'question_ids': question_ids,
+            'question_count': question_count,
             'pager': pager,
             'tag': tag,
             'filters': filters,
@@ -134,7 +135,7 @@ class WebsiteForum(http.Controller):
 
     @http.route(['/forum/<model("forum.forum"):forum>/faq'], type='http', auth="public", website=True, multilang=True)
     def forum_faq(self, forum, **post):
-        values = self._prepare_forum_values(forum=forum, searches=dict(), **post)
+        values = self._prepare_forum_values(forum=forum, searches=dict(), header={'is_guidelines': True}, **post)
         return request.website.render("website_forum.faq", values)
 
     @http.route('/forum/get_tags', type='http', auth="public", multilang=True, methods=['GET'], website=True)
@@ -147,7 +148,7 @@ class WebsiteForum(http.Controller):
     def tags(self, forum, page=1, **post):
         cr, uid, context = request.cr, request.uid, request.context
         Tag = request.registry['forum.tag']
-        obj_ids = Tag.search(cr, uid, [('forum_id', '=', forum.id)], limit=None, context=context)
+        obj_ids = Tag.search(cr, uid, [('forum_id', '=', forum.id), ('posts_count', '>', 0)], limit=None, order='posts_count DESC', context=context)
         tags = Tag.browse(cr, uid, obj_ids, context=context)
         values = self._prepare_forum_values(forum=forum, searches={'tags': True}, **post)
         values.update({
@@ -426,7 +427,7 @@ class WebsiteForum(http.Controller):
         tag_count = User.search(cr, SUPERUSER_ID, [('karma', '>', 1)], count=True, context=context)
         pager = request.website.pager(url="/forum/users", total=tag_count, page=page, step=step, scope=30)
 
-        obj_ids = User.search(cr, SUPERUSER_ID, [('karma', '>', 1)], limit=step, offset=pager['offset'], context=context)
+        obj_ids = User.search(cr, SUPERUSER_ID, [('karma', '>', 1)], limit=step, offset=pager['offset'], order='karma DESC', context=context)
         users = User.browse(cr, SUPERUSER_ID, obj_ids, context=context)
         searches['users'] = 'True'
 
@@ -590,12 +591,13 @@ class WebsiteForum(http.Controller):
 
     @http.route('/forum/<model("forum.forum"):forum>/post/<model("forum.post"):post>/comment/<model("mail.message"):comment>/convert_to_answer', type='http', auth="public", multilang=True, website=True)
     def convert_comment_to_answer(self, forum, post, comment, **kwarg):
-        values = {
-            'content': comment.body,
-        }
+        body = comment.body
         request.registry['mail.message'].unlink(request.cr, request.uid, [comment.id], context=request.context)
         question = post.parent_id if post.parent_id else post
-        return self.post_new(forum, question, **values)
+        for answer in question.child_ids:
+            if answer.create_uid.id == request.uid:
+                return self.post_comment(forum, answer, comment=html2plaintext(body))
+        return self.post_new(forum, question, content=body)
 
     @http.route('/forum/<model("forum.forum"):forum>/post/<model("forum.post"):post>/convert_to_comment', type='http', auth="user", multilang=True, website=True)
     def convert_answer_to_comment(self, forum, post, **kwarg):
diff --git a/addons/website_forum/data/badges_moderation.xml b/addons/website_forum/data/badges_moderation.xml
index 41f3eb7fe41ea583b60b24192e4875518cd4232f..8e3c1b3dda7f868c1086e7d5c8cd9087c51a6292 100644
--- a/addons/website_forum/data/badges_moderation.xml
+++ b/addons/website_forum/data/badges_moderation.xml
@@ -99,7 +99,7 @@
             <field name="domain" eval="[('model', '=', 'forum.post'), ('subtype_id', 'in', [ref('website_forum.mt_answer_edit'), ref('website_forum.mt_question_edit')])]"/>
             <field name="batch_mode">True</field>
             <field name="batch_distinctive_field" eval="ref('mail.field_mail_message_author_id')" />
-            <field name="batch_user_expression">user.id</field>
+            <field name="batch_user_expression">user.partner_id.id</field>
         </record>
         <record model="gamification.challenge" id="challenge_editor">
             <field name="name">Editor</field>
diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml
index 245169c23e94282bfdee44f92496d31b9b2f7fd1..a387a8de7ae331d01494217ef9b0f38d6d406311 100644
--- a/addons/website_forum/data/forum_data.xml
+++ b/addons/website_forum/data/forum_data.xml
@@ -13,10 +13,7 @@
             <field name="sequence" type="int">35</field>
         </record>
 
-        <record id="default_allow_auth_signup" model="ir.config_parameter"> 
-            <field name="key">auth_signup.allow_uninvited</field>
-            <field name="value" eval="True"/>
-        </record>
+        <function model="ir.config_parameter" name="set_param" eval="('auth_signup.allow_uninvited', True)" />
 
         <!-- JUMP TO FORUM AT INSTALL -->
         <record id="action_open_forum" model="ir.actions.act_url">
diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py
index 7a8385d1a821795c9f9cff0bfaf3d6d696ac0e4e..061b9e55eb8fcdf24dd63c92d97da409e055de6c 100644
--- a/addons/website_forum/models/forum.py
+++ b/addons/website_forum/models/forum.py
@@ -70,6 +70,7 @@ class Post(osv.Model):
     _name = 'forum.post'
     _description = 'Forum Post'
     _inherit = ['mail.thread', 'website.seo.metadata']
+    _order = "is_correct DESC, vote_count DESC"
 
     def _get_user_vote(self, cr, uid, ids, field_name, arg, context):
         res = dict.fromkeys(ids, 0)
diff --git a/addons/website_forum/static/src/css/website_forum.css b/addons/website_forum/static/src/css/website_forum.css
index ab8ea684aae2004b74e4bc16bbea3566927c5fe3..b90c1786e24883a38891cd877c7f8b98970df407 100644
--- a/addons/website_forum/static/src/css/website_forum.css
+++ b/addons/website_forum/static/src/css/website_forum.css
@@ -21,6 +21,9 @@
   background-color: #cccccc;
   margin-left: 4px;
 }
+.question .badge-active {
+  background-color: #428bca;
+}
 
 .oe_grey {
   background-color: #eeeeee;
diff --git a/addons/website_forum/static/src/css/website_forum.sass b/addons/website_forum/static/src/css/website_forum.sass
index da2df1460aabad9c21fa39bf09d9194c1f15b3d4..f8e46f06b79e67fa793a63df6f2c162ec0cdfd5d 100644
--- a/addons/website_forum/static/src/css/website_forum.sass
+++ b/addons/website_forum/static/src/css/website_forum.sass
@@ -17,6 +17,8 @@
   .badge
     background-color: #ccc
     margin-left: 4px
+  .badge-active
+    background-color: #428bca
 
 .oe_grey
   background-color: #eeeeee
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index bd8b47f08173fea3ca993dec029363ddd087a7ef..c73486d7d39c97ab7475dcb8e981cbef1cabba87 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -92,7 +92,8 @@
                         </div>
                         <div class="panel-body">
                             <t t-raw="forum.description"/><br/>
-                            <a t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
+                            <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
+                            <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
                         </div>
                     </div>
                     <div t-if="header.get('question_data')">
@@ -144,8 +145,11 @@
                     <span t-if="not question.active"><b> [Deleted]</b></span>
                     <span t-if="question.state == 'close'"><b> [Closed]</b></span>
             </div>
-            <t t-foreach="question.tag_ids" t-as="tag">
-                <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge pull-right" t-field="tag.name"/>
+            <t t-foreach="question.tag_ids" t-as="question_tag">
+                <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
+                    <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
+                        style="margin-right: 4px;"/>
+                </a>
             </t>
             <div class="text-muted">
                 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
@@ -208,14 +212,14 @@
 <template id="forum_index" name="Forum">
     <t t-call="website_forum.header">
         <h1 class="page-header mt0">
-            <t t-esc="len(question_ids)"/> <span>Questions</span>
+            <t t-esc="question_count"/> <span>Questions</span>
             <t t-esc="search"/>
             <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                   <t t-if="filters == 'all'">All</t>
                   <t t-if="filters == 'unanswered'">Unanswered</t>
                   <t t-if="filters == 'followed'">Followed</t>
-                  <t t-if="filters == 'tag'">Tag</t>
+                  <t t-if="tag"><span t-field="tag.name"/></t>
                   <t t-if="sorting == 'date'"> by activity date</t>
                   <t t-if="sorting == 'answered'"> by most answered</t>
                   <t t-if="sorting == 'vote'"> by most voted</t>
@@ -332,12 +336,12 @@
             users having a high karma can see closed questions to moderate
             them.
         </p>
-        <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(post)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
+        <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
             <input name="post_id" t-att-value="question.id" type="hidden"/>
             <div class="form-group">
                 <label class="col-md-3 control-label" for="reason">Question:</label>
                 <div class="col-md-8 mt8">
-                    <span t-field="post.name"/>
+                    <span t-field="question.name"/>
                 </div>
             </div>
             <div class="form-group">
@@ -354,7 +358,7 @@
                 <div class="col-md-offset-3 col-md-8">
                     <button class="btn btn-primary">Close question</button>
                     <span class="text-muted">or</span>
-                    <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }">back to question</a>
+                    <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
                 </div>
             </div>
         </form>
@@ -451,7 +455,7 @@
                                 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"> Close</a>
                             </li>
                             <li t-if="question.state == 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
-                                <a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)/reopen">reopen</a>
+                                <a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"> Reopen</a>
                             </li>
                             <li t-if="(user.id == question.create_uid.id and can_edit_own) or can_edit_all">
                                 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"> Edit</a>
@@ -467,7 +471,7 @@
                     <div>
                         <span t-field="question.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
                         <div>
-                            <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
+                            <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
                                 t-field="question.create_uid"
                                 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
                                 style="display: inline-block;"/>
diff --git a/addons/website_google_map/views/google_map.xml b/addons/website_google_map/views/google_map.xml
index 1c4254786f223b0fe91f4da339cd7a920257f156..d9a9d2740e837ec3e6e060a1fb355edcf6b61975 100644
--- a/addons/website_google_map/views/google_map.xml
+++ b/addons/website_google_map/views/google_map.xml
@@ -26,10 +26,10 @@
       }
     </style>
     <script>var partner_url = '<t t-raw="partner_url or ''"/>';</script>
-    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
+    <script src="//maps.google.com/maps/api/js?sensor=false"></script>
     <script type="text/javascript" t-attf-src="/google_map/partners.json?partner_ids=#{ partner_ids }"></script>
     <script type="text/javascript" src="/website_google_map/static/src/js/markerclusterer_compiled.js"></script>
-    <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
+    <script src="//code.jquery.com/jquery-1.6.1.min.js"></script>
     <script type="text/javascript" src="/website_google_map/static/src/js/google_map.js"></script>
   </head>
   <body>
diff --git a/addons/website_mail/data/mail_groups.xml b/addons/website_mail/data/mail_groups.xml
index 0bc8d3e81d1346f6cab401ffb5394d83605ea38c..b5d037ca866a4a539ebd6760f3d599279991b727 100644
--- a/addons/website_mail/data/mail_groups.xml
+++ b/addons/website_mail/data/mail_groups.xml
@@ -3,9 +3,9 @@
     <data noupdate="1">
 
         <record model="mail.group" id="group_all_employees">
-            <field name="name">Newsletter</field>
+            <field name="name">Discussion Group</field>
             <field name="public">public</field>
-            <field name="description">Public Newsletter.</field>
+            <field name="description">Public Discussion Group</field>
         </record>
 
     </data>
diff --git a/addons/website_mail/static/src/img/blocks/button_group_subscribe.png b/addons/website_mail/static/src/img/blocks/button_group_subscribe.png
new file mode 100644
index 0000000000000000000000000000000000000000..204239a8e0c50a79c13c4accc0f12e769dd2a31a
Binary files /dev/null and b/addons/website_mail/static/src/img/blocks/button_group_subscribe.png differ
diff --git a/addons/website_mail/static/src/js/website_mail.editor.js b/addons/website_mail/static/src/js/website_mail.editor.js
index 7a26920682b3ad71a77b94b7d389b442067cf933..fdfb948121faefc652e1340156a8561f29f325af 100644
--- a/addons/website_mail/static/src/js/website_mail.editor.js
+++ b/addons/website_mail/static/src/js/website_mail.editor.js
@@ -10,7 +10,7 @@
             return website.prompt({
                 id: "editor_new_subscribe_button",
                 window_title: _t("Add a Subscribe Button"),
-                select: _t("Mailing List"),
+                select: _t("Discussion List"),
                 init: function (field) {
                     return website.session.model('mail.group')
                             .call('name_search', ['', [['public','=','public']]], { context: website.get_context() });
diff --git a/addons/website_mail/views/snippets.xml b/addons/website_mail/views/snippets.xml
index 98a793932114088dea775dae5938f170536c8c92..c9f76ce4273765eeb585c8a7c5303009fe76822e 100644
--- a/addons/website_mail/views/snippets.xml
+++ b/addons/website_mail/views/snippets.xml
@@ -499,8 +499,8 @@
     <xpath expr="//div[@id='snippet_content']" position="inside">
         <div>
             <div class="oe_snippet_thumbnail">
-                <img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
-                <span class="oe_snippet_thumbnail_title">Subscribe Button</span>
+                <img class="oe_snippet_thumbnail_img" src="/website_mail/static/src/img/blocks/button_group_subscribe.png"/>
+                <span class="oe_snippet_thumbnail_title">Discussion Group</span>
             </div>
 
             <div class="oe_snippet_body input-group js_follow"
@@ -516,7 +516,7 @@
                     <a href="#" class="btn btn-default js_unfollow_btn">Unsubscribe</a>
                     <a href="#" class="btn btn-primary js_follow_btn">Subscribe</a>
                 </span>
-                <div class="alert alert-success hidden">thanks for your subscription!</div>
+                <div class="alert alert-success hidden">Thanks for your subscription!</div>
             </div>
 
         </div>
@@ -529,7 +529,7 @@
             data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
            >
             <li>
-                <a href="#" class="button js_mailing_list">Change mailing list</a>
+                <a href="#" class="button js_mailing_list">Change Discussion List</a>
             </li>
         </div>
     </xpath>
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index df8adb5e080453ff71cf6a66a5b82cdb3cf5c773..e49ed5f408997d5d6a73b5cfc4e745bb3e3527ba 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -406,14 +406,16 @@ class Ecommerce(http.Controller):
                 order.amount_total,
                 request.website._render("website_sale.total", {'website_sale_order': order})]
 
-    @http.route(['/shop/set_cart_json'], type='json', auth="public")
+    @http.route(['/shop/set_cart_json'], type='json', auth="public", website=True, multilang=True)
     def set_cart_json(self, path=None, product_id=None, order_line_id=None, set_number=0, json=None):
         quantity = request.registry['website']._ecommerce_add_product_to_cart(request.cr, request.uid,
             product_id=product_id, order_line_id=order_line_id, set_number=set_number,
             context=request.context)
         order = self.get_order()
         return [quantity,
-                order.get_number_of_products()]
+                order.get_number_of_products(),
+                order.amount_total,
+                request.website._render("website_sale.total", {'website_sale_order': order})]
     
     @http.route(['/shop/checkout'], type='http', auth="public", website=True, multilang=True)
     def checkout(self, **post):
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index 8d0027337ffa4435ce097efc842d1f3d39a203d0..c8225e4e49981e67092077565d044d21a8f1fd9a 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -33,7 +33,7 @@ class SaleOrder(osv.Model):
 class SaleOrderLine(osv.Model):
     _inherit = "sale.order.line"
 
-    def _recalculate_product_values(self, cr, uid, ids, product_id=0, context=None):
+    def _recalculate_product_values(self, cr, uid, ids, product_id=0, fiscal_position=False, context=None):
         # TDE FIXME: seems to be defined several times -> fix me ?
         if context is None:
             context = {}
@@ -49,5 +49,6 @@ class SaleOrderLine(osv.Model):
             pricelist=context.pop('pricelist'),
             product=product_id,
             partner_id=user_obj.browse(cr, SUPERUSER_ID, uid).partner_id.id,
+            fiscal_position=fiscal_position,
             context=context
         )['value']
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py
index 630a410c6d8e145d1d8aac9de180a9d8f467b99d..9ad0b63df16bf18bfb8001a65bf9ef838641a2a8 100644
--- a/addons/website_sale/models/website.py
+++ b/addons/website_sale/models/website.py
@@ -111,7 +111,7 @@ class Website(orm.Model):
 
         # change and record value
         if quantity:
-            vals = order_line_obj._recalculate_product_values(cr, uid, order_line_ids, product_id, context=context)
+            vals = order_line_obj._recalculate_product_values(cr, uid, order_line_ids, product_id, fiscal_position=order.fiscal_position.id, context=context)
             values.update(vals)
             values['product_uom_qty'] = quantity
             values['product_id'] = product_id
@@ -119,12 +119,11 @@ class Website(orm.Model):
 
             product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
             values['name'] = "%s: %s" % (product.name, product.variants) if product.variants else product.name
-            values['tax_id'] = [(6, 0, [tax.id for tax in product.taxes_id])]
-            if order_line_id:
-                order_line_obj.write(cr, SUPERUSER_ID, order_line_ids, values, context=context)
-            else:
-                order_line_id = order_line_obj.create(cr, SUPERUSER_ID, values, context=context)
-                order_obj.write(cr, SUPERUSER_ID, [order.id], {'order_line': [(4, order_line_id)]}, context=context)
+            if values.get('tax_id'):
+                values['tax_id'] = [(6, 0, values['tax_id'])]
+
+            order_obj.write(cr, SUPERUSER_ID, [order.id], {'order_line': [(1, order_line_id, values) if order_line_id else (0, 0, values)]}, context=context)
+
         elif order_line_ids:
             order_line_obj.unlink(cr, SUPERUSER_ID, order_line_ids, context=context)
 
diff --git a/addons/website_sale/static/description/index.html b/addons/website_sale/static/description/index.html
index f6a9d50443e885aab253f3c3e2edf9f3ae9ce850..8a006ff9c566dff0f774bb6494bb2efcac99d155 100644
--- a/addons/website_sale/static/description/index.html
+++ b/addons/website_sale/static/description/index.html
@@ -122,7 +122,7 @@
 <section class="oe_container oe_dark">
     <div class="oe_row">
         <h2 class="oe_slogan">Fine Tune Your Catalog</h2>
-        <h3 class="oe_slogan">Boost Sales by Emphasazing Best Products</h3>
+        <h3 class="oe_slogan">Boost Sales by Emphasizing Best Products</h3>
         <div class="oe_span6">
           <p class='oe_mt32'>
 			  Get a full control on how you display your products in
diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index 21113326c7da4e03d9a1e54665e55a2b378df2a6..1f6928c8b87b8b4b1e95e050b126b33062432dea 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -20,18 +20,20 @@ $(document).ready(function () {
             .fadeIn(600);
     }
 
-    $(".oe_website_sale .oe_mycart input.js_quantity").change(function () {
+    $(".oe_website_sale .oe_mycart input.js_quantity").change(function (ev) {
         var $input = $(this);
+        var $link = $(ev.currentTarget);
         var value = parseInt($input.val(), 10);
         if (isNaN(value)) value = 0;
         openerp.jsonRpc("/shop/set_cart_json", 'call', {'order_line_id': $input.data('id'), 'set_number': value})
             .then(function (data) {
-                if (!data) {
+                if (!data[0]) {
                     location.reload();
                     return;
                 }
                 set_my_cart_quantity(data[1]);
-                $input.val(data[0]);
+                $link.parents(".input-group:first").find(".js_quantity").val(data[0]);
+                $('#mycart_total').replaceWith(data[3]);
             });
     });
 
diff --git a/addons/website_sale_delivery/models/sale_order.py b/addons/website_sale_delivery/models/sale_order.py
index c6ac851d9d4a448bd14cf5a5e980800db1766074..029190d35c8dedef557a97aa923f1ba64efd1d60 100644
--- a/addons/website_sale_delivery/models/sale_order.py
+++ b/addons/website_sale_delivery/models/sale_order.py
@@ -82,10 +82,10 @@ class SaleOrder(orm.Model):
                         carrier_id = delivery_id
                         break
                 order.write({'carrier_id': carrier_id}, context=context)
-                if carrier_id:
-                    order.delivery_set(context=context)
-                else:
-                    order._delivery_unset(context=context)                    
+            if carrier_id:
+                order.delivery_set(context=context)
+            else:
+                order._delivery_unset(context=context)                    
 
         return bool(carrier_id)
 
diff --git a/addons/website_sale_delivery/models/website.py b/addons/website_sale_delivery/models/website.py
index efd8b2233d28c3acdf6c5efeb8845ecc91e15d54..0de2506d3dc0533dc4a7dba46806f47a36dd7dfd 100644
--- a/addons/website_sale_delivery/models/website.py
+++ b/addons/website_sale_delivery/models/website.py
@@ -17,4 +17,5 @@ class Website(orm.Model):
             product_id=product_id, order_line_id=order_line_id, number=number, set_number=set_number,
             context=context)
         order = self.ecommerce_get_current_order(cr, uid, context=context)
-        return self.pool['sale.order']._check_carrier_quotation(cr, uid, order, force_carrier_id=None, context=context) and quantity or None
+        self.pool['sale.order']._check_carrier_quotation(cr, uid, order, force_carrier_id=None, context=context) and quantity or None
+        return quantity
diff --git a/addons/website_twitter/security/ir.model.access.csv b/addons/website_twitter/security/ir.model.access.csv
index eb88063e9c5669c7405517731d549b6fd7e7cf0c..77cdce2adaaf0c8e01bbae8d30acf0f80409ce2b 100644
--- a/addons/website_twitter/security/ir.model.access.csv
+++ b/addons/website_twitter/security/ir.model.access.csv
@@ -1,2 +1,3 @@
 id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
 access_website_twitter_tweet_public,access of twitter snippet,website_twitter.model_website_twitter_tweet,,1,0,0,0
+access_website_twitter_tweet_manage,manage tweets,website_twitter.model_website_twitter_tweet,base.group_website_publisher,1,1,1,1