Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4838 Widoki

when creating invoice I want to add it to the thread if there is more than 17 invoice_lines

 @api.multi
        def _run_threaded_invoice(self, ):
            with Environment.manage():
                new_cr = self.pool.cursor()
                self = self.with_env(self.env(cr=new_cr))
                self.action_invoice_open()
                new_cr.commit()
                new_cr.close()


@api.multi
    def action_invoice_open(self):
        thread = False
        if self.type == 'in_invoice' and len(self.invoice_line_ids) > 17 and thread == False:
            thread = True
            threaded_calculation = threading.Thread(
                target=self._run_threaded_invoice)
            threaded_calculation.start()



           #and other logic that i have added to this method 

but i do get errors

TransactionRollbackError: could not serialize access due to concurrent update

PoolError: The Connection Pool Is Full

this looks very familiar to me as recursion error...

how do i set up thread correctly?

Awatar
Odrzuć
Najlepsza odpowiedź

It seems it is a database pool connection issue. Can you show your config and server characteristics as RAM and CPU?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
7200
3
wrz 21
9157
0
sie 21
3894
4
lip 16
12237
0
kwi 23
2305