diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 2183e17e740..bf4d34a2206 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -178,9 +178,20 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): partners_amount = dict((i[0],0) for i in partners_partial) for partner_info in partners_partial: if partner_info[2]: - # in case of partial reconciliation, we want to keep the left amount in the oldest period - self.cr.execute('''SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s''', (partner_info[2],)) + # in case of partial reconciliation, we want to keep the remaining amount in the + # period corresponding to the maturity date of the invoice. + self.cr.execute(''' + SELECT MAX(COALESCE(l.date_maturity, l.date)) + FROM account_move_line AS l + JOIN account_account AS a ON l.account_id = a.id + WHERE reconcile_partial_id = %s + AND a.type IN %s + ''', (partner_info[2], tuple(self.ACCOUNT_TYPE),)) date = self.cr.fetchall() + # Just in case date is not defined (but it should be defined) + if date and not date[0][0]: + self.cr.execute('''SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s''', (partner_info[2],)) + date = self.cr.fetchall() partial = False if 'BETWEEN' in dates_query: partial = date and args_list[-3] <= date[0][0] <= args_list[-2] diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 29d9f9f6eb8..7568c2fbfba 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1035,7 +1035,9 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo this.trigger('change',this); }, get_unit_price: function(){ - return round_di(this.price || 0, this.pos.dp['Product Price']) + var digits = this.pos.dp['Product Price']; + // round and truncate to mimic _sybmbol_set behavior + return parseFloat(round_di(this.price || 0, digits).toFixed(digits)); }, get_unit_display_price: function(){ if (this.pos.config.iface_tax_included) { diff --git a/addons/portal/static/src/css/portal.css b/addons/portal/static/src/css/portal.css index 5157b1a8027..8c9bdff52ae 100644 --- a/addons/portal/static/src/css/portal.css +++ b/addons/portal/static/src/css/portal.css @@ -3,7 +3,6 @@ /* Establish a stacking context on top of which the payment_acquirers::before element can be positioned */ position: relative; - z-index: 0; } diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py index cf8ec015bc0..b69a47d8a68 100644 --- a/addons/stock/procurement.py +++ b/addons/stock/procurement.py @@ -462,13 +462,12 @@ class procurement_order(osv.osv): ''' Create procurement based on Orderpoint - :param bool use_new_cursor: if set, use a dedicated cursor and auto-commit after processing each procurement. + :param bool use_new_cursor: if set, use dedicated cursors and auto-commit after processing + 1000 orderpoints. This is appropriate for batch jobs only. ''' if context is None: context = {} - if use_new_cursor: - cr = openerp.registry(cr.dbname).cursor() orderpoint_obj = self.pool.get('stock.warehouse.orderpoint') procurement_obj = self.pool.get('procurement.order') product_obj = self.pool.get('product.product') @@ -480,6 +479,8 @@ class procurement_order(osv.osv): while orderpoint_ids: ids = orderpoint_ids[:1000] del orderpoint_ids[:1000] + if use_new_cursor: + cr = openerp.registry(cr.dbname).cursor() product_dict = {} ops_dict = {} ops = orderpoint_obj.browse(cr, uid, ids, context=context) @@ -546,12 +547,10 @@ class procurement_order(osv.osv): if use_new_cursor: cr.commit() + cr.close() if prev_ids == ids: break else: prev_ids = ids - if use_new_cursor: - cr.commit() - cr.close() return {} \ No newline at end of file diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 237da2f677a..9e23b207c01 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -239,7 +239,7 @@ class stock_quant(osv.osv): 'quantity': qty, 'product_uom_id': move.product_id.uom_id.id, 'ref': move.picking_id and move.picking_id.name or False, - 'date': move.date, + 'date': fields.date.context_today(self, cr, uid, context=context), 'partner_id': partner_id, 'debit': valuation_amount > 0 and valuation_amount or 0, 'credit': valuation_amount < 0 and -valuation_amount or 0, @@ -251,7 +251,7 @@ class stock_quant(osv.osv): 'quantity': qty, 'product_uom_id': move.product_id.uom_id.id, 'ref': move.picking_id and move.picking_id.name or False, - 'date': move.date, + 'date': fields.date.context_today(self, cr, uid, context=context), 'partner_id': partner_id, 'credit': valuation_amount > 0 and valuation_amount or 0, 'debit': valuation_amount < 0 and -valuation_amount or 0, diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index e1e5d087ab3..a72cf529106 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1672,6 +1672,7 @@ .openerp .oe_application .oe_form_sheetbg { background: url(/web/static/src/img/form_sheetbg.png); border-bottom: 1px solid #ddd; + z-index: 1; } .openerp .oe_application .oe_form_sheetbg .oe_subtotal_footer label { font-weight: bold; @@ -2433,6 +2434,10 @@ .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field select { min-width: 0; } +.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea.field_text { + position: relative; + z-index: 1; +} .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float.oe_readonly, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer.oe_readonly { padding: 6px 0px 0px; text-align: right; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 1fe887a4a8d..0391b597f27 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1402,6 +1402,7 @@ $sheet-padding: 16px .oe_form_sheetbg background: url(/web/static/src/img/form_sheetbg.png) border-bottom: 1px solid #ddd + z-index: 1 // Customize font weight according bootstrap3 .oe_subtotal_footer label font-weight: bold @@ -1999,6 +2000,9 @@ $sheet-padding: 16px margin: 0 input, textarea, select min-width: 0 + textarea.field_text + position: relative + z-index: 1 &.oe_form_field_float,&.oe_form_view_integer &.oe_readonly padding: 6px 0px 0px diff --git a/doc/cla/corporate/metalsartigan.md b/doc/cla/corporate/metalsartigan.md new file mode 100644 index 00000000000..a49cdd39186 --- /dev/null +++ b/doc/cla/corporate/metalsartigan.md @@ -0,0 +1,15 @@ +Canada, 2017-4-4 + +Métal Sartigan agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Jérôme Thériault jerther@gmail.com https://github.com/jerther + +List of contributors: + +Jérôme Thériault jerther@gmail.com https://github.com/jerther diff --git a/openerp/models.py b/openerp/models.py index 7f9779df505..4be6a76d36c 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -744,7 +744,7 @@ class BaseModel(object): field = cls._fields.get(name) if not field: _logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name) - if not (field.store or field.column and field.column._fnct_inv): + elif not (field.store or field.column and field.column._fnct_inv): _logger.warning("method %s.%s: @constrains parameter %r is not writeable", cls._name, attr, name) methods.append(func)