A Divendres, 28 de desembre de 2012 16:46:58, Oscar Alvarez va escriure: > El 27/12/12 17:51, Cédric Krier escribió: > > On 24/12/12 11:16 +0100, Cédric Krier wrote: > >> On 24/12/12 02:19 +0100, Albert Cervera i Areny wrote: > >>> A Dilluns, 24 de desembre de 2012 01:41:43, Cédric Krier va escriure: > >>>> On 24/12/12 01:15 +0100, Albert Cervera i Areny wrote: > >>>>> A Diumenge, 4 de març de 2012 03:49:24, [email protected] va > >>> > >>> escriure: > >>>>>> Reviewers: , > >>>>>> > >>>>>> > >>>>>> > >>>>>> Please review this at http://codereview.tryton.org/266002/ > >>>>>> > >>>>>> Affected files: > >>>>>> M trytond/model/modelsql.py > >>>>>> M trytond/model/modelstorage.py > >>>>>> M trytond/tests/test_tryton.py > >>>>> > >>>>> I have a couple of questions that I'd like to ask before adding the > >>>>> changes to this patch: > >>>>> > >>>>> - In the sale module, the code for creating an invoice uses the > >>>>> ActiveRecord pattern and ends up with a list of SaleLine instances. > >>>>> Current code uses a loop over those objects and calls .save() on each > >>>>> of them. This is can be improved with the new create() but I thought > >>>>> that the following would work and > >>>>> > >>>>> it didn't: > >>>>> invoice = self._get_invoice_sale(invoice_type) > >>>>> > >>>>> + invoice.lines = invoice_lines > >>>>> > >>>>> invoice.save() > >>>>> > >>>>> I thought this would be similar to the non-ActiveRecord pattern and > >>>>> would be equivalent to [('create', invoice_line_values)] but it is > >>>>> not. > >>>> > >>>> When reading the code, for me it is equivalent. How do you conclude > >>>> this? > >>> > >>> Because I get the following error when trying to process a sale from > >>> the client. > >>> > >>> You try to read records that don't exist anymore! > >>> (Document type: account.invoice.line) > >>> > >>> Any idea on why this could happen? > >> > >> No, you should check the traceback. > > > > Any news on this topic? > > Just, a simple comment about this topic, in our company, the CEO's have > decided change the current ERP (SIIGO) for next year for another ERP, > because it is very slow in some transactions and reports (with big > information inside) and it isn't hardware or network problem, so then > the performance is a important item for the companys today.
I know it is. The tests I'm doing include sales with 6000 lines because we currently have a customer with those numbers. The good news is once the create with list patch will be ready you will be able to process (create shipment and invoice) with "just" 23 minutes (in a normal machine). Before the patch that simply didn't work (more than 20 hours). Also, duplicating a sale order with 200 lines passes from 7 seconds to 2, which is not bad either, specially considering the number of checks Tryton does. -- Albert Cervera i Areny http://www.NaN-tic.com Tel: +34 93 553 18 03 http://twitter.com/albertnan http://www.nan-tic.com/blog -- -- [email protected] mailing list
