diff --git a/addons/account/account.py b/addons/account/account.py index 994e32e1e28..792e4c40912 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2056,6 +2056,8 @@ class account_tax(osv.osv): amount = amount2 child_tax = self._unit_compute(cr, uid, tax.child_ids, amount, product, partner, quantity) res.extend(child_tax) + for child in child_tax: + amount2 += child.get('amount', 0.0) if tax.child_depend: for r in res: for name in ('base','ref_base'): diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 4f1de653ae1..63ca07ac00b 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -219,7 +219,7 @@ class account_analytic_account(osv.osv): res['value']['description'] = template.description return res - def on_change_partner_id(self, cr, uid, ids,partner_id, name, context={}): + def on_change_partner_id(self, cr, uid, ids,partner_id, name, context=None): res={} if partner_id: partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 71008e0855b..965086461fb 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -432,6 +432,14 @@ def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_v 'old_value_text': key in old_values and old_values[key]['text'].get(field_name) } lines[key].append(data) + # On read log add current values for fields. + if method == 'read': + data={ + 'name': field_name, + 'old_value': key in old_values and old_values[key]['value'].get(field_name), + 'old_value_text': key in old_values and old_values[key]['text'].get(field_name) + } + lines[key].append(data) return lines def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None): diff --git a/addons/auth_oauth/auth_oauth_data.xml b/addons/auth_oauth/auth_oauth_data.xml index 6abdab41b7c..fe64f42b2f6 100644 --- a/addons/auth_oauth/auth_oauth_data.xml +++ b/addons/auth_oauth/auth_oauth_data.xml @@ -2,13 +2,13 @@ - OpenERP.com Accounts - https://accounts.openerp.com/oauth2/auth + Odoo.com Accounts + https://accounts.odoo.com/oauth2/auth userinfo - https://accounts.openerp.com/oauth2/tokeninfo + https://accounts.odoo.com/oauth2/tokeninfo zocial openerp - Log in with OpenERP.com + Log in with Odoo.com diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 8ed3890ce69..222e5cca49e 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -329,19 +329,20 @@ class gamification_challenge(osv.Model): self.write(cr, uid, [challenge.id], {'user_ids': [(4, user.id) for user in challenge.autojoin_group_id.users]}, context=context) self.generate_goals_from_challenge(cr, uid, [challenge.id], context=context) - # goals closed but still opened at the last report date - closed_goals_to_report = goal_obj.search(cr, uid, [ - ('challenge_id', '=', challenge.id), - ('start_date', '>=', challenge.last_report_date), - ('end_date', '<=', challenge.last_report_date) - ]) + if challenge.last_report_date != fields.date.today(): + # goals closed but still opened at the last report date + closed_goals_to_report = goal_obj.search(cr, uid, [ + ('challenge_id', '=', challenge.id), + ('start_date', '>=', challenge.last_report_date), + ('end_date', '<=', challenge.last_report_date) + ]) - if len(closed_goals_to_report) > 0: - # some goals need a final report - self.report_progress(cr, uid, challenge, subset_goal_ids=closed_goals_to_report, context=context) + if fields.date.today() >= challenge.next_report_date: + self.report_progress(cr, uid, challenge, context=context) - if fields.date.today() == challenge.next_report_date: - self.report_progress(cr, uid, challenge, context=context) + elif len(closed_goals_to_report) > 0: + # some goals need a final report + self.report_progress(cr, uid, challenge, subset_goal_ids=closed_goals_to_report, context=context) self.check_challenge_reward(cr, uid, ids, context=context) return True diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 932a290b4a1..b6b95427db1 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -90,6 +90,11 @@ class hr_holidays_status(osv.osv): } def name_get(self, cr, uid, ids, context=None): + + if not context.get('employee_id',False): + # leave counts is based on employee_id, would be inaccurate if not based on correct employee + return super(hr_holidays_status, self).name_get(cr, uid, ids, context=context) + res = [] for record in self.browse(cr, uid, ids, context=context): name = record.name diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index d4b84bab012..2c1772405ca 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -83,7 +83,7 @@ - + diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index e434090ad76..22073ea6389 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -491,11 +491,9 @@ class marketing_campaign_activity(osv.osv): active_ids=[workitem.res_id], active_model=workitem.object_id.model, workitem=workitem) - res = server_obj.run(cr, uid, [activity.server_action_id.id], + server_obj.run(cr, uid, [activity.server_action_id.id], context=action_context) - # server action return False if the action is performed - # except client_action, other and python code - return res == False and True or res + return True def process(self, cr, uid, act_id, wi_id, context=None): activity = self.browse(cr, uid, act_id, context=context) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 0a2b96fd273..3161a8950c8 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -565,7 +565,7 @@ class pos_order(osv.osv): try: self.signal_paid(cr, uid, [order_id]) except Exception as e: - _logger.error('Could not mark POS Order as Paid: %s', tools.ustr(e)) + _logger.error('Could not fully process the POS Order: %s', tools.ustr(e)) if to_invoice: self.action_invoice(cr, uid, [order_id], context) @@ -725,8 +725,6 @@ class pos_order(osv.osv): move_obj = self.pool.get('stock.move') for order in self.browse(cr, uid, ids, context=context): - if not order.state=='draft': - continue addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {} picking_id = picking_obj.create(cr, uid, { 'origin': order.name, diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index 077a2399c55..0c7ba8f9e1e 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -146,6 +146,9 @@ function openerp_pos_db(instance, module){ var product = products[i]; var search_string = this._product_search_string(product); var categ_id = product.public_categ_id ? product.public_categ_id[0] : this.root_category_id; + if (product.variants){ + product.name = product.name+" ("+product.variants+")"; + } if(!stored_categories[categ_id]){ stored_categories[categ_id] = []; } diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 6c65b0bcfbf..4c39c8234ad 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -219,7 +219,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return self.fetch( 'product.product', - ['name', 'list_price','price','public_categ_id', 'taxes_id', 'ean13', 'default_code', + ['name', 'list_price','price','public_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants', 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'], [['sale_ok','=',true],['available_in_pos','=',true]], {pricelist: self.pricelist.id} // context for price diff --git a/addons/product/product.py b/addons/product/product.py index 523aae8b076..8496245ea91 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -833,14 +833,10 @@ class product_product(osv.osv): return res def copy(self, cr, uid, id, default=None, context=None): - context = context or {} - default = dict(default or {}) + if context is None: + context={} - # Craft our own ` (copy)` in en_US (self.copy_translation() - # will do the other languages). - context_wo_lang = dict(context or {}) - context_wo_lang.pop('lang', None) - product = self.browse(cr, uid, id, context_wo_lang) + product = self.browse(cr, uid, id, context) if context.get('variant'): # if we copy a variant or create one, we keep the same template default['product_tmpl_id'] = product.product_tmpl_id.id diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index 14b719ebd7a..613475b87f8 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -21,8 +21,8 @@ - - + + diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index bdd5ac9fd6f..a7f7bbfc869 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -622,13 +622,13 @@ class sale_order_line(osv.osv): res_packing = self.product_packaging_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, packaging, context=context) res['value'].update(res_packing.get('value', {})) warning_msgs = res_packing.get('warning') and res_packing['warning']['message'] or '' - compare_qty = float_compare(product_obj.virtual_available * uom2.factor, qty * product_obj.uom_id.factor, precision_rounding=product_obj.uom_id.rounding) + compare_qty = float_compare(product_obj.virtual_available, qty, precision_rounding=uom2.rounding) if (product_obj.type=='product') and int(compare_qty) == -1 \ - and (product_obj.procure_method=='make_to_stock'): + and (product_obj.procure_method=='make_to_stock'): warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \ - (qty, uom2 and uom2.name or product_obj.uom_id.name, - max(0,product_obj.virtual_available), product_obj.uom_id.name, - max(0,product_obj.qty_available), product_obj.uom_id.name) + (qty, uom2.name, + max(0,product_obj.virtual_available), uom2.name, + max(0,product_obj.qty_available), uom2.name) warning_msgs += _("Not enough stock ! : ") + warn_msg + "\n\n" #update of warning messages diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index a5f6ad2cfa6..6bb3b726edb 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -65,7 +65,7 @@ class sale_quote(http.Controller): order = order_obj.browse(request.cr, SUPERUSER_ID, order_id) if token != order.access_token: return request.website.render('website.404') - attachments=sign and [('signature.png', sign)] or [] + attachments=sign and [('signature.png', sign.decode('base64'))] or [] order_obj.signal_order_confirm(request.cr, SUPERUSER_ID, [order_id], context=request.context) message = _('Order signed by %s') % (signer,) self.__message_post(message, order_id, type='comment', subtype='mt_comment', attachments=attachments)