Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo9 community - how to add a sequence to a form using the frontend

By
oregional
on 11/28/15, 8:00 AM 526 views

Hello

I am trying to add a sequence to tasks in a specific project using the webbrowser using odoo9 community release.

Our workflow: when an email is sent to our helpdesk it should be processed automatically, a new task should be created in a specific project, the task should get a unique identifier and it should be emailed back to the customer.

I managed to set up the email, the tasks are created, email is sent back, this is fine.

However I can not get the sequence to be created.

This is what I did:

1) created a new sequence at Settings->Technical->Sequences&Identifier->Sequences. Sequence code: x_itc_helpdesk_task_id

Question 1: where/how do I set that the sequence should be genereated when the new task is created? It should only be generated for tasks with project_id = 2

2) created a new field called for model "Task" with name x_itc_helpdesk_task_id_sequence

Question 2: do I really need a field or the view can pick up automagically sequences?

Question 3: if I need to have a field, what should be the field type and how to link it with the sequence?

3) created a new view for this field, it is a form that is extending the project.task object, field is only shown for project_id 2

<xpath expr="//field[@name='tag_ids']" position="after">
<field name="x_itc_helpdesk_task_id_sequence" attrs="{'invisible': [('project_id', '!=', 2)]}"/>
</xpath>


I've been browsing for hours the forums and other places, I have found references that for example I need to set _defaults (http://stackoverflow.com/questions/22477712/how-to-add-autoincremental-field-in-openerp-7), but I dont know how to do that from the frontend

Many thanks for any hints,

cheers,

gezza

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/28/15, 8:00 AM
Seen: 526 times
Last updated: 11/28/15, 8:00 AM