Port account_several_improvements.diff to v12
This commit is contained in:
@@ -1,53 +1,36 @@
|
|||||||
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
|
diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py
|
||||||
index 8ed1e48..615da43 100644
|
index f32e4c9b474..4c32df1800e 100644
|
||||||
--- a/addons/account/models/account_bank_statement.py
|
--- a/addons/account/models/reconciliation_widget.py
|
||||||
+++ b/addons/account/models/account_bank_statement.py
|
+++ b/addons/account/models/reconciliation_widget.py
|
||||||
@@ -563,7 +563,13 @@ class AccountBankStatementLine(models.Model):
|
@@ -482,12 +482,16 @@ class AccountReconciliation(models.AbstractModel):
|
||||||
|
:param excluded_ids:
|
||||||
|
:param search_str:
|
||||||
"""
|
"""
|
||||||
# Blue lines = payment on bank account not assigned to a statement yet
|
-
|
||||||
reconciliation_aml_accounts = [self.journal_id.default_credit_account_id.id, self.journal_id.default_debit_account_id.id]
|
|
||||||
- domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('payment_id','<>', False)]
|
|
||||||
+ # AKRETION HACK 11/7/2017
|
|
||||||
+ # Remove ('payment_id','<>', False) in order to allow to select move lines
|
+ # Remove ('payment_id','<>', False) in order to allow to select move lines
|
||||||
+ # generated from payment orders or check deposit
|
+ # generated from payment orders or check deposit
|
||||||
+ # but I add ('journal_id', '=', self.journal_id.id) to exclude the
|
+ # but I add ('journal_id', '=', self.journal_id.id) to exclude the
|
||||||
+ # opening entry of the first fiscal year
|
+ # opening entry of the first fiscal year and other unrelated moves
|
||||||
+ #domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('payment_id','<>', False)]
|
domain_reconciliation = [
|
||||||
+ domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('journal_id', '=', self.journal_id.id)]
|
'&', '&',
|
||||||
|
('statement_line_id', '=', False),
|
||||||
|
('account_id', 'in', aml_accounts),
|
||||||
|
- ('payment_id', '<>', False)
|
||||||
|
+ ('journal_id', '=', st_line.journal_id.id),
|
||||||
|
+ # ('payment_id', '<>', False)
|
||||||
|
]
|
||||||
|
|
||||||
# Black lines = unreconciled & (not linked to a payment or open balance created by statement
|
# default domain matching
|
||||||
domain_matching = [('reconciled', '=', False)]
|
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
|
||||||
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
|
index 53f28e0c620..1721d01edf9 100644
|
||||||
index b60ffbe..6c27c57 100644
|
--- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
|
||||||
--- a/addons/account/models/account_move.py
|
+++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
|
||||||
+++ b/addons/account/models/account_move.py
|
@@ -514,7 +514,7 @@ var LineRenderer = Widget.extend(FieldManagerMixin, {
|
||||||
@@ -599,6 +599,7 @@ class AccountMoveLine(models.Model):
|
}
|
||||||
domain = expression.AND([domain, [('id', 'not in', excluded_ids)]])
|
return this.model.makeRecord('account.bank.statement.line', [field], {
|
||||||
if str:
|
partner_id: {
|
||||||
str_domain = [
|
- domain: ["|", ["is_company", "=", true], ["parent_id", "=", false], "|", ["customer", "=", true], ["supplier", "=", true]],
|
||||||
+ '|', ('account_id.code', '=ilike', str + '%'),
|
+ domain: ["|", ["is_company", "=", true], ["parent_id", "=", false]],
|
||||||
'|', ('move_id.name', 'ilike', str),
|
options: {
|
||||||
'|', ('move_id.ref', 'ilike', str),
|
no_open: true
|
||||||
'|', ('date_maturity', 'like', str),
|
}
|
||||||
diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js
|
|
||||||
index 453bd41..48c396e 100644
|
|
||||||
--- a/addons/account/static/src/js/account_reconciliation_widgets.js
|
|
||||||
+++ b/addons/account/static/src/js/account_reconciliation_widgets.js
|
|
||||||
@@ -76,7 +76,7 @@ var abstractReconciliation = Widget.extend(ControlPanelMixin, {
|
|
||||||
this.model_res_users = new Model("res.users");
|
|
||||||
this.model_tax = new Model("account.tax");
|
|
||||||
this.model_presets = new Model("account.reconcile.model");
|
|
||||||
- this.max_move_lines_displayed = 5;
|
|
||||||
+ this.max_move_lines_displayed = 15;
|
|
||||||
// Number of reconciliations loaded initially and by clicking 'show more'
|
|
||||||
this.num_reconciliations_fetched_in_batch = 10;
|
|
||||||
this.animation_speed = 100; // "Blocking" animations
|
|
||||||
@@ -1755,7 +1755,7 @@ var bankStatementReconciliationLine = abstractReconciliationLine.extend({
|
|
||||||
relation: "res.partner",
|
|
||||||
string: _t("Partner"),
|
|
||||||
type: "many2one",
|
|
||||||
- domain: [['parent_id','=',false], '|', ['customer','=',true], ['supplier','=',true]],
|
|
||||||
+ domain: [['parent_id','=',false]], // AKRETION HACK 26/6/2017 allow all parent partners
|
|
||||||
help: "",
|
|
||||||
readonly: false,
|
|
||||||
required: true,
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
|
|
||||||
index 4374528..aea1361 100644
|
|
||||||
--- a/addons/account/models/account_bank_statement.py
|
|
||||||
+++ b/addons/account/models/account_bank_statement.py
|
|
||||||
@@ -1008,7 +1008,7 @@ class AccountBankStatementLine(models.Model):
|
|
||||||
#record the move name on the statement line to be able to retrieve it in case of unreconciliation
|
|
||||||
self.write({'move_name': move.name})
|
|
||||||
payment.write({'payment_reference': move.name})
|
|
||||||
- elif self.move_name:
|
|
||||||
- raise UserError(_('Operation not allowed. Since your statement line already received a number, you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.'))
|
|
||||||
+ #elif self.move_name:
|
|
||||||
+ # raise UserError(_('Operation not allowed. Since your statement line already received a number, you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.'))
|
|
||||||
counterpart_moves.assert_balanced()
|
|
||||||
return counterpart_moves
|
|
||||||
Reference in New Issue
Block a user