Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
7698 Visualizzazioni

Hello

In my bespoke system, I like to have a hyperlink on issues to a forum question if applicable. Open ERP does not seem to provide the field or link function.

Avatar
Abbandona
Risposta migliore

You need to add a Custom Field to Project Issues.

First, log in as Administrator and make sure the Technical Features are enabled. In the Settings menu:

  • Go to Users, find and open "Administrator", and in the Access Rightstab checkTechnical Features`.

Second, create the custom field in the database:

  • Go to Technical -> Database Structure, find and edit the "Project Issue" model
  • At the bottom of the Fields tab, "Add an Item"
  • Create the new field:
    • Name: x_url
    • Field Label: Hyperlink
    • Field Type: char
    • Size 200
    • Save & Close the "Create Fields" dialog
  • "Save" the Project Issue changes

Finally, add the field to the form:

  • Go to Technical -> User Interface, find and edit the "Project Issue Tracker Form"
  • In the Architecture text, find and replace:

                    <group groups="base.group_user">
                        <field name="user_id"/>
    

with

                    <group groups="base.group_user">
                        <field name="x_url" widget="url"/>
                        <field name="user_id"/>

And it's done. Now go to Project Issues and you'll see the new field available.

For fields that are not URLs just remove the "widget=...". Just write: <field name="my_field_name"/>. See all attributes a field can have inn the official docs.

Avatar
Abbandona
Autore

Fantastic, thanks a lot. That showed me a little that its nice and open and can be changed.

Autore

How do I add fields that are not url fields and have them appear with a larger box (like description). Set type to char size 400 or text. But what should the widget be in xml architecture for this type of field? <field name="x_url" widget="url"/>

For fields that are not URLs just remove the "widget=...". Just write: &lt;field name="my_field_name"/&gt;. - just added this to the answer.

Autore

Daniel, thanks. How can I however increase the size of the data entry field?

Changing the field's size in the Database Structure should be enough. I chose 200, but you can change that to whatever size.

Autore

Sorry I meant on the form view rather than in the database structure

In the form you only need to tell where you want to place the field, and optionally add some display attributes, such as the widget to use. The size and type is defined in the database structure. If for some reason the size change isn't taking effect, try restarting the OpenERP server.

Post correlati Risposte Visualizzazioni Attività
2
ott 23
1580
0
ott 21
1791
0
ago 15
2977
3
giu 15
7930
1
mar 15
6400