Re: [tryton-dev] ImportError: cannot import name register_default_jsonb

2018-04-13 Thread Carlos Ibrahim Arias
El viernes, 13 de abril de 2018, 15:20:11 (UTC+1), Sergi Almacellas Abellana  
escribió:
> El 13/04/18 a les 10:59, Carlos Ibrahim Arias ha escrit:
> > Hello,
> > 
> > I'm testing tryton version 4.6 on a centos 7 host. I did the installation 
> > with no errors using the following script 
> > https://bitbucket.org/carlos_ia/trytoninstall/src/454963514b8270619c948c376a2318dcfb86c3cc/tryton-install?at=default=file-view-default
> >  based on nantic tools.
> > 
> > When trying to the init setup I got the following error:
> > 
> > [tryton@trytontest ~]$ /home/tryton/trytonERP/trytond/bin/trytond-admin 
> > --config /etc/trytond.conf -d cialDB --logconf /etc/trytond_log.conf --all
> > [Fri Apr 13 08:51:01 2018] INFO:server:using /etc/trytond_log.conf as 
> > logging configuration file
> > Traceback (most recent call last):
> >   File "/home/tryton/trytonERP/trytond/bin/trytond-admin", line 21, in 
> > 
> > admin.run(options)
> >   File "/home/tryton/trytonERP/trytond/trytond/admin.py", line 20, in run
> > Database = backend.get('Database')
> >   File "/home/tryton/trytonERP/trytond/trytond/backend/__init__.py", line 
> > 34, in get
> > raise exception
> > ImportError: cannot import name register_default_jsonb
> 
> The error is due to this changeset:
> 
> http://hg.tryton.org/trytond/rev/5eb2714a75da
> 
> which raised the required version of psycopg2 to 2.5.4
> 
> It seems that you have an older version. You should upgrade pyscopg2 in
> order to fix it.
> 
> Hope it helps.
> 
> -- 
> Sergi Almacellas Abellana
> www.koolpi.com
> Twitter: @pokoli_srk

It works. Gracias!

-- 
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/114fff7a-7aaf-470b-84c2-e72b2407ecda%40googlegroups.com.


[tryton-dev] ImportError: cannot import name register_default_jsonb

2018-04-13 Thread Carlos Ibrahim Arias
Hello,

I'm testing tryton version 4.6 on a centos 7 host. I did the installation with 
no errors using the following script 
https://bitbucket.org/carlos_ia/trytoninstall/src/454963514b8270619c948c376a2318dcfb86c3cc/tryton-install?at=default=file-view-default
 based on nantic tools.

When trying to the init setup I got the following error:

[tryton@trytontest ~]$ /home/tryton/trytonERP/trytond/bin/trytond-admin 
--config /etc/trytond.conf -d cialDB --logconf /etc/trytond_log.conf --all
[Fri Apr 13 08:51:01 2018] INFO:server:using /etc/trytond_log.conf as logging 
configuration file
Traceback (most recent call last):
  File "/home/tryton/trytonERP/trytond/bin/trytond-admin", line 21, in 
admin.run(options)
  File "/home/tryton/trytonERP/trytond/trytond/admin.py", line 20, in run
Database = backend.get('Database')
  File "/home/tryton/trytonERP/trytond/trytond/backend/__init__.py", line 34, 
in get
raise exception
ImportError: cannot import name register_default_jsonb

I disabled firewalld and SElinux is on permissive mode so the issue does not 
have anything to do them.

Anyone can help?

Thanks in advanced,

Carlos

-- 
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/cd27cb71-cf3b-417e-8e58-bb7971c6361b%40googlegroups.com.


[tryton-dev] Product category is always mandatory

2017-11-10 Thread Carlos Ibrahim Arias
Hello,

I have an installation with tryton 4.2 and users are reporting that the system 
is always setting up new products with the options "Use accounts of the 
category by default" and "Use taxes of the category by default", so that it is 
mandatory to assing a category, eventhough this two options are set up to false 
(deactivated) in the product configuration form.

Do any one know anything about this bug? Is it a bug?

Thanks in advanced,

Carlos

-- 
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/65528330-52ce-4697-b707-ae324ba716ca%40googlegroups.com.


Re: [tryton-dev] Problems using one2many and many2many fields

2017-05-03 Thread Carlos Ibrahim Arias
I created the model Z_MecialHistory to store information of the patient (*date, 
patient and healthprofessional*) and it is related to the model PatientData. 
The point is that, as Albert said, I need to access to the information in 
the model PatientEvaluation.

After adding the function field Albert recommended to the model 
PatientEvaluation


z_medical_history = fields.Function(fields.Many2Many(
'gnuhealth.z_medical_history',
 None, None, 'Historial Medico del Paciente'), 
'get_z_medical_history')


... I added the following function to PatientEvaluation model guessing that 
I had to use the current patient 

def get_z_medical_history(self, name):
pool = Pool()
Patient = pool.get('gnuhealth.patient')
return Patient.z_medical_history

But it doesnt work... I dont really understant how to the get function 
should be coded to worrk...





And got the following error...





El miércoles, 3 de mayo de 2017, 8:46:36 (UTC+1), Albert Cervera i Areny 
escribió:
>
> 2017-05-03 4:23 GMT+02:00 Carlos Ibrahim Arias <brai...@gmail.com 
> >: 
> > Hi! I'm having problems using a one2many field on another model 
> different 
> > from the class it was created on. I tried to use a many2many field so 
> that I 
> > can view the related fields but cant make it work 
> > 
> > This is the first class... 
> > 
> > class Z_MedicalHistory(ModelSQL, ModelView): 
> > 
> > 'Patient Medical History' 
> > __name__ = 'gnuhealth.z_medical_history' 
> > 
> > medical_history_date = fields.DateTime('Date and Time', 
> required=True) 
> > 
> > healthprof = fields.Many2One( 
> > 'gnuhealth.healthprofessional', 'Health Prof', 
> > select=True, required=True, help='Health Professional') 
> > 
> > patient = fields.Many2One( 
> > 'gnuhealth.patient', 'Patient', 
> > select=True, required=True, help='Patient Name') 
> > 
> > comments = fields.Text('Comments', required=True) 
> > 
> > @staticmethod 
> > def default_medical_history_date(): 
> > return datetime.now() 
> > 
> > @staticmethod 
> > def default_healthprof(): 
> > pool = Pool() 
> > HealthProfessional = pool.get('gnuhealth.healthprofessional') 
> > return HealthProfessional.get_health_professional() 
> > 
> > 
> > @staticmethod 
> > def default_patient(): 
> > pool = Pool() 
> > Patient = pool.get('gnuhealth.patient') 
> > return Patient.name 
> > 
> > 
> > I added the following lines to the class PatientData (gnuhealth.patient) 
> so 
> > that they are related 
> > 
> > z_medical_history = fields.One2Many( 
> > 'gnuhealth.z_medical_history', 
> > 'Z_MedicalHistory', 'Patient Medical History', help='Enter the 
> > Patient Medical History' 
> > ' for the patient.') 
>
> AFAIS the One2Many definition should be: 
>
>  z_medical_history = fields.One2Many( 
>  'gnuhealth.z_medical_history', 
>  'patient', 'Patient Medical History', help='Enter the Patient 
> Medical History' 
>  ' for the patient.') 
>
> Note the second parameter must be the name of the Many2One field of 
> the related model. 
>
> > 
> > 
> > 
> > The problem is that there is another class call PatientEvaluation where 
> I 
> > need to hace access and view Z_MedicalHistory using the patient field of 
> > PatientEvaluation. Tried the following but it's not working: 
> > 
> > z_medical_history = fields.Many2Many('gnuhealth.z_medical_history', 
> > 'patient', None, 'Historial Medico del Paciente', 
> > domain=[('patient', '=', Eval('patient'))], 
> > depends=['patient']) 
>
> If you need to access the information of z_medial_history from another 
> model either you link it directly or you create a Function field. I 
> guess the latter is what you're looking for. So you need something 
> like this: 
>
>  z_medical_history = 
> fields.Function(fields.Many2Many('gnuhealth.z_medical_history', 
>  None, None, 'Historial Medico del Paciente'), 
> 'get_z_medial_history') 
>
>
> > 
> > I guess I'm not doing it right. :( 
> > 
> > Thanks it advanced! 
> > 
> > 
> > -- 
> > 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/5e9dceb7-28d3-4dc1-be43-61b5834cf895%40googlegroups.com.
>  
>
>
>
>
> -- 
> Albert Cervera i Areny 
> http://www.NaN-tic.com 
> Tel. 93 553 18 03 
>

-- 
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/27fea2b4-79d6-4019-a477-3f1dbf17d8d2%40googlegroups.com.


[tryton-dev] Problems using one2many and many2many fields

2017-05-03 Thread Carlos Ibrahim Arias
Hi! I'm having problems using a one2many field on another model different 
from the class it was created on. I tried to use a many2many field so that 
I can view the related fields but cant make it work

This is the first class... 

class Z_MedicalHistory(ModelSQL, ModelView):

'Patient Medical History'
__name__ = 'gnuhealth.z_medical_history'

medical_history_date = fields.DateTime('Date and Time', required=True)

healthprof = fields.Many2One(
'gnuhealth.healthprofessional', 'Health Prof',
select=True, required=True, help='Health Professional')

patient = fields.Many2One(
'gnuhealth.patient', 'Patient',
select=True, required=True, help='Patient Name')

comments = fields.Text('Comments', required=True)

@staticmethod
def default_medical_history_date():
return datetime.now()

@staticmethod
def default_healthprof():
pool = Pool()
HealthProfessional = pool.get('gnuhealth.healthprofessional')
return HealthProfessional.get_health_professional()


@staticmethod
def default_patient():
pool = Pool()
Patient = pool.get('gnuhealth.patient')
return Patient.name


I added the following lines to the class PatientData (gnuhealth.patient) so 
that they are related

z_medical_history = fields.One2Many(
'gnuhealth.z_medical_history',
'Z_MedicalHistory', 'Patient Medical History', help='Enter the 
Patient Medical History'
' for the patient.')



The problem is that there is another class call PatientEvaluation where I 
need to hace access and view Z_MedicalHistory using the patient field of 
PatientEvaluation. Tried the following but it's not working:

z_medical_history = fields.Many2Many('gnuhealth.z_medical_history',
'patient', None, 'Historial Medico del Paciente',
domain=[('patient', '=', Eval('patient'))],
depends=['patient'])

I guess I'm not doing it right. :(

Thanks it advanced!


-- 
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/5e9dceb7-28d3-4dc1-be43-61b5834cf895%40googlegroups.com.


Re: [tryton-dev] Restore colors attribute on tree view

2017-04-10 Thread Carlos Ibrahim Arias
I understand that this function has been deprecated and removed from the 
code but the point is that there are final users for whom this is a 
requirement. We should give them the possibility to chose what they want 
for their usability and accessibility if they consider is good for them. 

In this case the final user is demanding this option. Please help me to 
fullfill his requirement. 

I restored all the removed code indicated at the changeset 
http://hg.tryton.org/trytond/rev/f21ba9c81eb6, but when adding the 
following @classmethod for testing to the class Appointment the elements in 
the tree view are in black color, and they should be in red color.

@classmethod
def view_attributes(cls):
return [('/tree', 'colors', 'red')]

Thanks in advanced


El jueves, 30 de marzo de 2017, 14:05:05 (UTC+1), Cédric Krier escribió:
>
> On 2017-03-30 04:56, Carlos Ibrahim Arias wrote: 
> > I tried to restore the color attribute adding back all the removed lines 
> > but I'm getting the following error: 
> > 
> > Anyone can help? 
>
> I doubt you will find any help to restore a feature that was decided to 
> remove. Instead I can suggest you to use icons instead of colors. They 
> are better for accessibility because they are readable for blind people 
> and they can express an exact meaning. 
>
> -- 
> Cédric Krier - B2CK SPRL 
> Email/Jabber: cedric...@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/3ba7bf01-dd4e-4775-ae81-a02d04f7056f%40googlegroups.com.


[tryton-dev] Restore colors attribute on tree view

2017-03-30 Thread Carlos Ibrahim Arias
Hello World : )

I'm developing an installation using tryton 3.8 to gnuhealth 3 and the 
client wants to use colors on tree views in appointments and other models.

I found that this functionallity was removed as indicated on 
https://tryton-rietveld.appspot.com/16551002

I tried to restore the color attribute adding back all the removed lines 
but I'm getting the following error:

Traceback (most recent call last):
  File "/trytond/protocols/jsonrpc.py", line 162, in _marshaled_dispatch
response['result'] = dispatch_method(method, params)
  File "/trytond/protocols/jsonrpc.py", line 191, in _dispatch
res = dispatch(*args)
  File "/trytond/protocols/dispatcher.py", line 162, in dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 342, in fields_view_get
result['field_childs'])
  File "/trytond/model/modelview.py", line 398, in _view_look_dom_arch
for xpath, attribute, value in cls.view_attributes():
TypeError: unbound method view_attributes() must be called with ir.module 
instance as first argument (got nothing instead)

Anyone can help?

Thanks in advanced,

Carlos

-- 
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/45d703e8-2d09-4759-884a-3c62866da8cf%40googlegroups.com.