-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7669871
commit fe9d52c
Showing
29 changed files
with
1,077 additions
and
460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
account_bank_statement_advanced/static/src/js/reconciliation_model.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
# Copyright 2009-2020 Noviat. | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
*/ | ||
odoo.define('account_bank_statement_advanced.ReconciliationModel', function (require) { | ||
"use strict"; | ||
|
||
var ReconciliationModel = require('account.ReconciliationModel'); | ||
|
||
ReconciliationModel.StatementModel.include({ | ||
|
||
load: function (context) { | ||
if (context && context.statement_ids && context.st_line_ids) { | ||
context.statement_ids = context.statement_ids.concat( | ||
context.st_line_ids.map(function (x) {return x * -1}) | ||
); | ||
}; | ||
return this._super(context); | ||
}, | ||
|
||
loadData: function (ids, excluded_ids) { | ||
var context = this.context; | ||
if (context && context.st_line_ids) { | ||
ids = context.st_line_ids; | ||
}; | ||
return this._super(ids, excluded_ids); | ||
}, | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2009-2020 Noviat. | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
import base64 | ||
import logging | ||
|
||
from odoo import api, SUPERUSER_ID | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def migrate(cr, version): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
|
||
codas = env['account.coda'].search([]) | ||
for coda in codas: | ||
data = coda.coda_data | ||
if not is_base64(data): | ||
coda.coda_data = base64.b64encode(data) | ||
_logger.warn( | ||
"CODA File %s (%s) has been repaired", | ||
coda.name, coda.coda_creation_date) | ||
|
||
|
||
def is_base64(data): | ||
try: | ||
data = data.replace(b'\n', b'') | ||
return data == base64.b64encode(base64.b64decode(data)) | ||
except Exception: | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.