Gantt View is not Documented, AnyBody can help me with this?

Asked by Nhomar - Vauxoo

Hello.

[b][u]Introducction[/u][/b]

I'm doing a simple module with a table with date_to and date_from fields to demostrate a concept for all views availables on OpenERP, but I don't find nothing about how call the gantt view on xml file.

[b][u]Question[/u][/b]
Exist some site where i can view this help??

My concept_proof_view.xml file call the gantt view with something like this:

[code]
<record model="ir.ui.view" id="concept_proof2_gantt">
<field name="name">concept.proof2.gantt</field>
<field name="model">concept.proof2</field>
<field name="type">gantt</field>
<field name="arch" type="xml">
<gantt string="Muchas Tiempos en Gantt" date_start="date_from" date_stop="date_to">
<level object="concept.proof2" link="field1" domain="[]">
<field name="field1" />
<field name="number"/>
</level>
</gantt>
</field>
</record>
[/code]

Tha class on the concept_proof2.py file is declared with this:

[code]
class concept_proof2(osv.osv):
    _name = 'concept.proof2'
    _description = 'Open ERP Model'
    _columns = {
        'field1':fields.char('Field 2', size=64, required=False, readonly=False),
        'aprobado':fields.boolean('Aprobado', required=False),
        'number_text': fields.char('Numerotext', size=64, required=False, readonly=False),
        'number_calc': fields.float('Numero to calc', digits=(16, 2)),
        'date_from': fields.date('Date From'),
        'date_to': fields.date('Date to'),

    }
concept_proof2()
[/code]

How you can see is only a table!! all views works fine but the Gantt view not show anything.... a table empty.... i want show a list of records on gantt with begin and end dates to make something to control grafically much records....

Thanks for you help

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Nhomar - Vauxoo
Solved:
Last query:
Last reply:
Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#1

I attach all may concept module, i smebody can proof it!

http://geronimo.com.ve/sites/all/files/concept_proof2.zip

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#2

Hello Nhomar,

You are missing 2 points here:
1. class concept_proof2 has no attribute _rec_name. Its columns have no field'name', so better you assign some field as _rec_name=field for this class.

2. <level object="concept.proof2" link="field1" domain="[]">.
     Here, link has to be a field which is in relation to the object concept.proof2.

Thank you.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#3

Hello Jay....

I saw the documentaton,
http://doc.openerp.com/developer/2_5_Objects_Fields_Methods/object_attributes.html

Can you give me some example of the sintax to the _rec_name attribute that i
need to add it, in other words, ??

I defined a _rec_name on the class:

class name_of_the_object(osv.osv):
        _name = 'name.of.the.object'
        _rec_name = 'field'
        _columns = { ... }
        ...
name_of_the_object()

What do i need to add on .py file???

Thanks

2009/11/11 Jay (Open ERP) <email address hidden>

> Your question #89214 on OpenObject Server changed:
> https://answers.launchpad.net/openobject-server/+question/89214
>
> Status: Open => Answered
>
> Jay (Open ERP) proposed the following answer:
> Hello Nhomar,
>
> You are missing 2 points here:
> 1. class concept_proof2 has no attribute _rec_name. Its columns have no
> field'name', so better you assign some field as _rec_name=field for this
> class.
>
> 2. <level object="concept.proof2" link="field1" domain="[]">.
> Here, link has to be a field which is in relation to the object
> concept.proof2.
>
>
> Thank you.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/openobject-server/+question/89214/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/openobject-server/+question/89214
>
> You received this question notification because you are a direct
> subscriber of the question.
>

--
Nhomar G. Hernandez M.
+58-414-4110269
+58-212-6615932
+58-212-9536734 ext 124
+58-212-9512643
Web-Blog: http://geronimo.com.ve
Repr: http://openerp.com.ve
Servicios IT: http://www.netquatro.com
Linux-Counter: 467724
Correos:
<email address hidden>
<email address hidden>
<email address hidden>

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#4

Hello....

I upgrade it....

I add the _rec_name="field1" on my example.... all instal very well even it is showing all views exactly like before th change calendar, tree, form is showing... but when i am intend to shwo gantt view the server answer:

[2009-11-10 09:33:16,715] ERROR:web-services:[13]: Traceback (most recent call last):
[2009-11-10 09:33:16,716] ERROR:web-services:[14]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 61, in wrapper
[2009-11-10 09:33:16,716] ERROR:web-services:[15]: return f(self, dbname, *args, **kwargs)
[2009-11-10 09:33:16,716] ERROR:web-services:[16]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 120, in execute
[2009-11-10 09:33:16,717] ERROR:web-services:[17]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-11-10 09:33:16,717] ERROR:web-services:[18]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 112, in execute_cr
[2009-11-10 09:33:16,717] ERROR:web-services:[19]: return getattr(object, method)(cr, uid, *args, **kw)
[2009-11-10 09:33:16,718] ERROR:web-services:[20]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2951, in name_get
[2009-11-10 09:33:16,718] ERROR:web-services:[21]: [self._rec_name], context, load='_classic_write')]
[2009-11-10 09:33:16,719] ERROR:web-services:[22]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2142, in read
[2009-11-10 09:33:16,719] ERROR:web-services:[23]: result = self._read_flat(cr, user, select, fields, context, load)
[2009-11-10 09:33:16,719] ERROR:web-services:[24]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2212, in _read_flat
[2009-11-10 09:33:16,720] ERROR:web-services:[25]: self._order), sub_ids)
[2009-11-10 09:33:16,720] ERROR:web-services:[26]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/sql_db.py", line 76, in wrapper
[2009-11-10 09:33:16,720] ERROR:web-services:[27]: return f(self, *args, **kwargs)
[2009-11-10 09:33:16,721] ERROR:web-services:[28]: File "/home/disco-antiguo/openerp/main/5.0/server/bin/sql_db.py", line 120, in execute
[2009-11-10 09:33:16,721] ERROR:web-services:[29]: res = self._obj.execute(query, params)
[2009-11-10 09:33:16,722] ERROR:web-services:[30]: DataError: la sintaxis de entrada no es válida para integer: «Dato1»

I didn't change the value of link="" , Is mandatory that i have a group many2one field?? what other propierty allow to me to show a GANtT view WITHOuT make a group??

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#5

Hello....

I upgrade it....

I add the _rec_name="field1" on my example.... all instal very well even it
is showing all views exactly like before th change calendar, tree, form is
showing... but when i am intend to shwo gantt view the server answer:

[2009-11-10 09:33:16,715] ERROR:web-services:[13]: Traceback (most recent
call last):
[2009-11-10 09:33:16,716] ERROR:web-services:[14]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 61, in
wrapper
[2009-11-10 09:33:16,716] ERROR:web-services:[15]: return f(self,
dbname, *args, **kwargs)
[2009-11-10 09:33:16,716] ERROR:web-services:[16]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 120, in
execute
[2009-11-10 09:33:16,717] ERROR:web-services:[17]: res =
pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-11-10 09:33:16,717] ERROR:web-services:[18]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/osv.py", line 112, in
execute_cr
[2009-11-10 09:33:16,717] ERROR:web-services:[19]: return
getattr(object, method)(cr, uid, *args, **kw)
[2009-11-10 09:33:16,718] ERROR:web-services:[20]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2951, in
name_get
[2009-11-10 09:33:16,718] ERROR:web-services:[21]: [self._rec_name],
context, load='_classic_write')]
[2009-11-10 09:33:16,719] ERROR:web-services:[22]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2142, in
read
[2009-11-10 09:33:16,719] ERROR:web-services:[23]: result =
self._read_flat(cr, user, select, fields, context, load)
[2009-11-10 09:33:16,719] ERROR:web-services:[24]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/osv/orm.py", line 2212, in
_read_flat
[2009-11-10 09:33:16,720] ERROR:web-services:[25]: self._order),
sub_ids)
[2009-11-10 09:33:16,720] ERROR:web-services:[26]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/sql_db.py", line 76, in
wrapper
[2009-11-10 09:33:16,720] ERROR:web-services:[27]: return f(self, *args,
**kwargs)
[2009-11-10 09:33:16,721] ERROR:web-services:[28]: File
"/home/disco-antiguo/openerp/main/5.0/server/bin/sql_db.py", line 120, in
execute
[2009-11-10 09:33:16,721] ERROR:web-services:[29]: res =
self._obj.execute(query, params)
[2009-11-10 09:33:16,722] ERROR:web-services:[30]: DataError: la sintaxis de
entrada no es válida para integer: «Dato1»

I didn't change the value of link="" , Is mandatory that i have a group
many2one field?? what other propierty allow to me to show a GANtT view
WITHOuT make a group??

Thanks
El 11 de noviembre de 2009 09:33, Nhomar Hernández <
<email address hidden>> escribió:

> Your question #89214 on OpenObject Server changed:
> https://answers.launchpad.net/openobject-server/+question/89214
>
> Status: Answered => Open
>
> You are still having a problem:
> Hello Jay....
>
> I saw the documentaton,
>
> http://doc.openerp.com/developer/2_5_Objects_Fields_Methods/object_attributes.html
>
> Can you give me some example of the sintax to the _rec_name attribute that
> i
> need to add it, in other words, ??
>
> I defined a _rec_name on the class:
>
> class name_of_the_object(osv.osv):
> _name = 'name.of.the.object'
> _rec_name = 'field'
> _columns = { ... }
> ...
> name_of_the_object()
>
>
>
> What do i need to add on .py file???
>
> Thanks
>
> 2009/11/11 Jay (Open ERP) <email address hidden>
>
> > Your question #89214 on OpenObject Server changed:
> > https://answers.launchpad.net/openobject-server/+question/89214
> >
> > Status: Open => Answered
> >
> > Jay (Open ERP) proposed the following answer:
> > Hello Nhomar,
> >
> > You are missing 2 points here:
> > 1. class concept_proof2 has no attribute _rec_name. Its columns have no
> > field'name', so better you assign some field as _rec_name=field for this
> > class.
> >
> > 2. <level object="concept.proof2" link="field1" domain="[]">.
> > Here, link has to be a field which is in relation to the object
> > concept.proof2.
> >
> >
> > Thank you.
> >
> > --
> > If this answers your question, please go to the following page to let us
> > know that it is solved:
> >
> >
> https://answers.launchpad.net/openobject-server/+question/89214/+confirm?answer_id=1
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/openobject-server/+question/89214
> >
> > You received this question notification because you are a direct
> > subscriber of the question.
> >
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#6

Hello,

"class name_of_the_object(osv.osv):
        _name = 'name.of.the.object'
        _rec_name = 'field'"

You did the right thing here.

And yes, link field has to be relational.

You may follow Project/Project_view.xml for an example.

Thank you.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#7

Hi Jay...

I got the view... but not complete....

I created a theorical field to group the elements and put a "link value"...
(something like categories.)

The Gantt View show me "only" a bar from FIRST start date to LAST end date
exactly like project... but the SUB-ELEMENTS like "tasks on project module"
dont show me Nothing....... Only the names on Left bar.... but not the
bars...

In other hand: "Where can I change the colors" of bars??, can i personalize
various colors for various "elements states"???? where? on project you can
see:

 <gantt* color="user_id"* date_delay="planned_hours" date_start="date_start"
string="Tasks">

I looked for user_id field on object <field
name="model">project.task</field> in the py file, and i supose that is the
user_id owner of the task, but where can I define the "color" for an
User_ID......

Thanks

2009/11/12 Jay (Open ERP) <email address hidden>

> Your question #89214 on OpenObject Server changed:
> https://answers.launchpad.net/openobject-server/+question/89214
>
> Status: Open => Answered
>
> Jay (Open ERP) proposed the following answer:
> Hello,
>
> "class name_of_the_object(osv.osv):
> _name = 'name.of.the.object'
> _rec_name = 'field'"
>
> You did the right thing here.
>
> And yes, link field has to be relational.
>
> You may follow Project/Project_view.xml for an example.
>
> Thank you.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/openobject-server/+question/89214/+confirm?answer_id=5
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/openobject-server/+question/89214
>
> You received this question notification because you are a direct
> subscriber of the question.
>

--
Nhomar G. Hernandez M.
+58-414-4110269
+58-212-6615932
+58-212-9536734 ext 124
+58-212-9512643
Web-Blog: http://geronimo.com.ve
Repr: http://openerp.com.ve
Servicios IT: http://www.netquatro.com
Linux-Counter: 467724
Correos:
<email address hidden>
<email address hidden>
<email address hidden>

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#8

The "Color" is automatically provided by the view dirferent for diferent values, every time when you put this field on "color" attribute... this document all this views..... some kind of tips are needed, like, how block propierties or values on this view....

Thanks