Single company migration

77 views
Skip to first unread message

Αργύρης Ξηρός

unread,
Feb 1, 2016, 8:05:39 AM2/1/16
to tryton
Hello everyone

I am currently running Tryton 3.4 with many different companies.
Is it possible to make a new and clean Tryton installation (of the same version) and migrate all the data from a single company?

And also, is there any way to properly change state of an entry doing also all the relevant actions with XMLrpc calls?
For example, process a 'draft' invoice and convert it to 'post' so the system will create account moves and etc.

Antonio Roncero

unread,
Feb 1, 2016, 12:35:04 PM2/1/16
to tryton


El lunes, 1 de febrero de 2016, 13:05:39 (UTC), Αργύρης Ξηρός escribió:
Hello everyone

I am currently running Tryton 3.4 with many different companies.
Is it possible to make a new and clean Tryton installation (of the same version) and migrate all the data from a single company?

If you want a new and clean installation maybe you can use proteus[1] to create migration scripts. I used it from Openerp to Tryton
 
And also, is there any way to properly change state of an entry doing also all the relevant actions with XMLrpc calls?
For example, process a 'draft' invoice and convert it to 'post' so the system will create account moves and etc.

I use proteus for that too

Cédric Krier

unread,
Feb 1, 2016, 5:45:03 PM2/1/16
to tryton
On 2016-02-01 05:05, Αργύρης Ξηρός wrote:
> Hello everyone
>
> I am currently running Tryton 3.4 with many different companies.
> Is it possible to make a new and clean Tryton installation (of the same
> version) and migrate all the data from a single company?

Maybe one "crazy" idea will be to set on the foreign key pointed to the
company table an "ON DELETE CASCADE", then delete all the copanies
except one.
Of course, try this on a copy of the database and repeat the process for
each company.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Αργύρης Ξηρός

unread,
Feb 2, 2016, 6:48:26 AM2/2/16
to tryton


Τη Δευτέρα, 1 Φεβρουαρίου 2016 - 7:35:04 μ.μ. UTC+2, ο χρήστης Antonio Roncero έγραψε: 
I use proteus for that too


Ok, so as I can see, on invoices there is a class method 'post(invoices)' which is responsible for the transition.

How can someone call that function from proteus?

Cédric Krier

unread,
Feb 2, 2016, 7:10:03 AM2/2/16
to tryton
Yes of course as any method decorated with ModelView.button.
But for migration, I will not advise to run workflow because it will
probably not generate the same data as on your old system (even if it is
Tryton). When I do migration, I only migrate raw data or draft document.
So generally it is only the referential parts (like Party, Product etc.)
and usually just an initial accounting balance. It happens that I had to
retrieve some document for history like older sales, in that case I just
import them in a done state without executing any workflow at all.

Αργύρης Ξηρός

unread,
Feb 5, 2016, 3:54:24 AM2/5/16
to tryton
After some quick tests I manage to build migration scripts of the companies (At least for the entries I am interesting for).

Although I ran into a syntax issue while using XMLrpc in python.
I try to create a 'Supplier Shipment' (or 'stock.shipment.in') but I can't relate the stock incoming moves of the shipment.

For example:
I have an array of the incoming moves:
moves = [1, 2, 3]

How am I suppose to link them with a specific 'Supplier Shipment'?
I tried:
getattr(self.server.model.stock.shipment, "in.write")(
 
[supplier_shipment_id],
 
{'moves' : moves},
 
self.context
)

but I get from the server:
xmlrpclib.Fault: <Fault 255: ''>


Αργύρης Ξηρός

unread,
Feb 5, 2016, 4:12:11 AM2/5/16
to tryton

Never mind, I manage to figure it out.
for move in moves:
 
self.server.model.stock.move.write(
   
[move],
   
{'shipment' : "stock.shipment.in,"+str(supplier_shipment_id)},
   
self.context
 
)


Thank you very much
 
Reply all
Reply to author
Forward
0 new messages