Re: [tryton-dev] import_data and model account with account_account_type (RESEND)

2018-04-19 Thread Richard PALO

Le 19/04/2018 à 17:38, Cédric Krier a écrit :

On 2018-04-18 17:40, Richard PALO wrote:

In the French plan, there are unfortunately 7 instances of 
account_account_type_template
with the name 'Autres'... but in the xml, there are indeed unique ID's...

Is the mapping of these (xml id => sql id) stored somewhere it can be accessed
to somehow facilitate import?


In "ir.model.data".


Great, for example in my case in hand I find a record with
  fs_id = 'creances_autres' having db_id = 196
which is correct for account_account_type_template

Guess I'm not sure what do I need to do to get 'creances_autres' (unique xml id)
to work instead of using the name 'Autres' for the 'type' (last field in 
account.csv)
Seems account_account_type_template record id's differ from 
account_account_type ids.

Perhaps first updating the 'type' field in each data record using the fs_id 
(e.g. 'creances_autres')
to the value found looking up  account_account_type having 'template' = the 
db_id (196)
followed by the actual import_data?

That is, using the real 'id' instead of 'name' should work, right?



That is, it would be very useful to be able to
use the xml id in import_data as unique label for the sql id.


Better to write a proteus script.



?? I believe migrate.py is a proteus script, no?

I'm in:  load_csv(Model.get('account.account'), load['account'])

which invokes Model.import_data...

--
Richard PALO

--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/190da4e6-afab-7482-0fa5-80769f105f8d%40netbsd.org.


Re: [tryton-dev] import_data and model account with account_account_type (RESEND)

2018-04-19 Thread Cédric Krier
On 2018-04-18 17:40, Richard PALO wrote:
> In the French plan, there are unfortunately 7 instances of 
> account_account_type_template
> with the name 'Autres'... but in the xml, there are indeed unique ID's...
> 
> Is the mapping of these (xml id => sql id) stored somewhere it can be accessed
> to somehow facilitate import?

In "ir.model.data".

> That is, it would be very useful to be able to
> use the xml id in import_data as unique label for the sql id.

Better to write a proteus script.

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

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20180419153838.GQ3929%40kei.