[MERGE] forward port branch saas-11 up to 2633bb4
This commit is contained in:
@@ -55,7 +55,7 @@ class AccountMove(models.Model):
|
|||||||
total_amount += amount
|
total_amount += amount
|
||||||
for partial_line in (line.matched_debit_ids + line.matched_credit_ids):
|
for partial_line in (line.matched_debit_ids + line.matched_credit_ids):
|
||||||
total_reconciled += partial_line.amount
|
total_reconciled += partial_line.amount
|
||||||
if total_amount == 0.0:
|
if float_is_zero(total_amount, precision_rounding=move.currency_id.rounding):
|
||||||
move.matched_percentage = 1.0
|
move.matched_percentage = 1.0
|
||||||
else:
|
else:
|
||||||
move.matched_percentage = total_reconciled / total_amount
|
move.matched_percentage = total_reconciled / total_amount
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class AccountPartialReconcileCashBasis(models.Model):
|
|||||||
#create reporting issues. Not sure of the behavior to implement in that case, though.
|
#create reporting issues. Not sure of the behavior to implement in that case, though.
|
||||||
# amount to write is the current cash_basis amount minus the one before the reconciliation
|
# amount to write is the current cash_basis amount minus the one before the reconciliation
|
||||||
matched_percentage = value_before_reconciliation[move.id]
|
matched_percentage = value_before_reconciliation[move.id]
|
||||||
amount = (line.credit_cash_basis - line.debit_cash_basis) - (line.credit - line.debit) * matched_percentage
|
amount = line.currency_id.round((line.credit_cash_basis - line.debit_cash_basis) - (line.credit - line.debit) * matched_percentage)
|
||||||
if not self._check_tax_exigible(line):
|
if not self._check_tax_exigible(line):
|
||||||
if line.tax_line_id and line.tax_line_id.use_cash_basis:
|
if line.tax_line_id and line.tax_line_id.use_cash_basis:
|
||||||
# group by line account
|
# group by line account
|
||||||
@@ -73,15 +73,15 @@ class AccountPartialReconcileCashBasis(models.Model):
|
|||||||
for tax in line.tax_ids:
|
for tax in line.tax_ids:
|
||||||
line_to_create.append((0, 0, {
|
line_to_create.append((0, 0, {
|
||||||
'name': '/',
|
'name': '/',
|
||||||
'debit': line.debit_cash_basis - line.debit * matched_percentage,
|
'debit': line.currency_id.round(line.debit_cash_basis - line.debit * matched_percentage),
|
||||||
'credit': line.credit_cash_basis - line.credit * matched_percentage,
|
'credit': line.currency_id.round(line.credit_cash_basis - line.credit * matched_percentage),
|
||||||
'account_id': line.account_id.id,
|
'account_id': line.account_id.id,
|
||||||
'tax_ids': [(6, 0, [tax.id])],
|
'tax_ids': [(6, 0, [tax.id])],
|
||||||
}))
|
}))
|
||||||
line_to_create.append((0, 0, {
|
line_to_create.append((0, 0, {
|
||||||
'name': '/',
|
'name': '/',
|
||||||
'credit': line.debit_cash_basis - line.debit * matched_percentage,
|
'credit': line.currency_id.round(line.debit_cash_basis - line.debit * matched_percentage),
|
||||||
'debit': line.credit_cash_basis - line.credit * matched_percentage,
|
'debit': line.currency_id.round(line.credit_cash_basis - line.credit * matched_percentage),
|
||||||
'account_id': line.account_id.id,
|
'account_id': line.account_id.id,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -485,7 +485,9 @@ class PurchaseOrder(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def action_set_date_planned(self):
|
def action_set_date_planned(self):
|
||||||
for order in self:
|
for order in self:
|
||||||
order.order_line.update({'date_planned': order.date_planned})
|
#DO NOT FORWARD PORT
|
||||||
|
for line in order.order_line:
|
||||||
|
line.update({'date_planned': order.date_planned})
|
||||||
|
|
||||||
|
|
||||||
class PurchaseOrderLine(models.Model):
|
class PurchaseOrderLine(models.Model):
|
||||||
|
|||||||
@@ -275,9 +275,10 @@ var PivotView = View.extend({
|
|||||||
col_domain = this.headers[col_id].domain,
|
col_domain = this.headers[col_id].domain,
|
||||||
context = _.omit(_.clone(this.context), 'group_by');
|
context = _.omit(_.clone(this.context), 'group_by');
|
||||||
|
|
||||||
var views = _.filter(this.options.action.views, function (view) {
|
var views = [
|
||||||
return view[1] === 'form' || view[1] === 'list';
|
_find_view_info.call(this, "list"),
|
||||||
});
|
_find_view_info.call(this, "form"),
|
||||||
|
];
|
||||||
|
|
||||||
return this.do_action({
|
return this.do_action({
|
||||||
type: 'ir.actions.act_window',
|
type: 'ir.actions.act_window',
|
||||||
@@ -290,6 +291,12 @@ var PivotView = View.extend({
|
|||||||
context: context,
|
context: context,
|
||||||
domain: this.domain.concat(row_domain, col_domain),
|
domain: this.domain.concat(row_domain, col_domain),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function _find_view_info(view_type) {
|
||||||
|
return _.find(this.options.action.views, function (view) {
|
||||||
|
return view[1] === view_type;
|
||||||
|
}) || [false, view_type];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
on_measure_row_click: function (event) {
|
on_measure_row_click: function (event) {
|
||||||
var $target = $(event.target),
|
var $target = $(event.target),
|
||||||
|
|||||||
@@ -564,12 +564,12 @@ class website(osv.osv):
|
|||||||
|
|
||||||
def search_pages(self, cr, uid, ids, needle=None, limit=None, context=None):
|
def search_pages(self, cr, uid, ids, needle=None, limit=None, context=None):
|
||||||
name = re.sub(r"^/p(a(g(e(/(w(e(b(s(i(t(e(\.)?)?)?)?)?)?)?)?)?)?)?)?", "", needle or "")
|
name = re.sub(r"^/p(a(g(e(/(w(e(b(s(i(t(e(\.)?)?)?)?)?)?)?)?)?)?)?)?", "", needle or "")
|
||||||
|
name = slugify(name, max_length=50)
|
||||||
res = []
|
res = []
|
||||||
for page in self.enumerate_pages(cr, uid, ids, query_string=name, context=context):
|
for page in self.enumerate_pages(cr, uid, ids, query_string=name, context=context):
|
||||||
if needle in page['loc']:
|
res.append(page)
|
||||||
res.append(page)
|
if len(res) == limit:
|
||||||
if len(res) == limit:
|
break
|
||||||
break
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def image_url(self, cr, uid, record, field, size=None, context=None):
|
def image_url(self, cr, uid, record, field, size=None, context=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user