[MERGE] forward port branch 8.0 up to 3128e84243
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
+1
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user