2017-04-26 4:28 GMT-03:00 Mauricio Martinez Garcia <[email protected]>:

> *Hello again Karla. *
>
>

>   I change my code and reduce only to the first part.
>
>  This is my code: https://pastebin.com/3c0RkQ63
>

​Hi Mauricio, that's much more clear​
I will try to clarify on the confusion because you seem to be talking about
something different than I was.


>
>   I want to associate first the account service with the line services of
> some client.
> ( in this case i don't have the asociation with product and enteprise
> tryton models on my diagram)
>
> ​So you will need to define a lines field (which you have so far called
'accounting_services_line' line 32 of your pastebin) in the
​AccountingService Model

This field should be a One2Many (and this is the one I was referring to all
the time in my previous email). And so you will need to add in the
AccountingServiceLine Model a field that points to the AccountingService
Model (this is the second parameter to your One2Many field on the first
Model).


>
> The model "medica.accounting_services" have the patient information, and
> in my case, i will associate to one enterprise or one DUMMY enterprise for
> individual transactions.
>
> Then, i review the information in the version 3.0 of tryton of this URL:
> http://doc.tryton.org/3.0/trytond/doc/ref/models/fields.
> html#ref-models-fields
>
> but,I don't understand wich part of the class is "read" the field of the
> other module.
>
>

>
> if you see, we have the next values: "Many2One(*model_name*, *string*[,
> *left*[, *right*[, *ondelete*[, *datetime_field*[, ***options*]]]]])¶
> <http://doc.tryton.org/3.0/trytond/doc/ref/models/fields.html#trytond.model.fields.Many2One>
> "
> On which part can i define the field that i will need?
>

I was talking about One2Many (please check my quoted text)
​


>
> I mean, of my definition, i need associate the next fields with the
> corresponding model field of the product.product model of tryton:
> (to the first field by the moment the relation is not implemented because
> i want to understand this association)
>
> services_concept = fields.Char('services_concept',size=50,"Concepto") #get
>> the Description product
>> services_product = fields.Many2One('product.product','code') #get the
>> product code
>>
>>
Now ​about the field 'services_product'​

On tryton you create a field relation to the model, and tryton will save it
in the database by using just it's id.
So I guess you don't need to force saving the 'code'.
Now I realize that code may not be the same of id in GNU health, so maybe
you just want a reference (Many2One) to the product and then a function
field to show the code on the screen.



> this is the output at database level.
> ( i want to show the code and description of this model product.product)
>

​I'm sorry, this tells nothing to me, it seems to me you are thinking
backwards about tryton​

​putting the database first, it's true you need to​ build a database, but
why do you insist in building first the database instead of thinking what
tryton provides you first ?
Are you trying to import some external data into tryton? In that case you
will likely just need to create a process that converts your database into
a valid tryton model.

from the line 50 to below of the code aren't updated right now.
>
>
> could you help me with your recommendation for do this one?
> the other question is, on which model do we have the price of the
> products?, i was review all models of kind product_* , but i don't see this
> one.
>

Please open a new thread for new unrelated questions.

​Cheers,
Karla

​P.S: Don't top post in this mailing list. See
http://groups.tryton.org/netiquette

-- 
-------------------------
Karla  Mª  Stenger  Sábat
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/CAF9qxNr1MtLiFc5jRS4H1GGVgR4O9VQ4CDiBBOxzK9P%2Biuy3JA%40mail.gmail.com.

Reply via email to