mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] mass writing of statement line in order to avoid store field chain computation
This commit is contained in:
@@ -26,6 +26,8 @@ from openerp.osv import fields, osv
|
|||||||
from parser import new_bank_statement_parser
|
from parser import new_bank_statement_parser
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
import profile
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
class AccountStatementProfil(Model):
|
class AccountStatementProfil(Model):
|
||||||
@@ -171,16 +173,19 @@ class AccountStatementProfil(Model):
|
|||||||
try:
|
try:
|
||||||
# Record every line in the bank statement and compute the global commission
|
# Record every line in the bank statement and compute the global commission
|
||||||
# based on the commission_amount column
|
# based on the commission_amount column
|
||||||
|
statement_store = []
|
||||||
for line in result_row_list:
|
for line in result_row_list:
|
||||||
parser_vals = parser.get_st_line_vals(line)
|
parser_vals = parser.get_st_line_vals(line)
|
||||||
values = self.prepare_statetement_lines_vals(
|
values = self.prepare_statetement_lines_vals(
|
||||||
cr, uid, parser_vals, account_payable,
|
cr, uid, parser_vals, account_payable,
|
||||||
account_receivable, statement_id, context)
|
account_receivable, statement_id, context)
|
||||||
# we finally create the line in system
|
# we finally create the line in system
|
||||||
statement_line_obj.create(cr, uid, values, context=context)
|
statement_store.append((0, 0, values))
|
||||||
# Build and create the global commission line for the whole statement
|
# Build and create the global commission line for the whole statement
|
||||||
comm_vals = self.prepare_global_commission_line_vals(
|
statement_obj.write(cr, uid, [statement_id],
|
||||||
cr, uid, parser, result_row_list, prof, statement_id, context)
|
{'line_ids': statement_store}, context=context)
|
||||||
|
comm_vals = self.prepare_global_commission_line_vals(cr, uid, parser, result_row_list,
|
||||||
|
prof, statement_id, context)
|
||||||
if comm_vals:
|
if comm_vals:
|
||||||
statement_line_obj.create(cr, uid, comm_vals, context=context)
|
statement_line_obj.create(cr, uid, comm_vals, context=context)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user