Most Powerful Open Source ERP

How To Update PDF Form

How To showing how to update a PDF form by modifying the underlying Scribus file.
  • Last Update:2016-02-11
  • Version:001
  • Language:en

After creating an ERP5 PDF Form using a Scribus file (HowToCreatePdfForm), you may want to modify the form by modifying the Scribus file.

Table of Contents

Modify the Scribus file

Modify the Scribus file of the Form you want to update. You can rename fields, change the font, add fields, everything is possible.

Select "Update Module from Scribus" from the "My favorite" menu.

A page appear with the following fields

  • Pdf Form:
    the new pdf file generated with your updated Scribus file
  • Scribus File:
    the updated Scribus file
  • Generate graphic interface instead of ERP5 Form:
    if this checkbox is checked a form with a background will be generated. So the html rendering will be near the same of the pdf file. It it's not checked, a stand ERP5 Form will be created
  • Desired Width:
    the desired width of the background image. If the orignal background image is bigger, all dimensions will be reduced using proportionality. You can set width an height, but just one is required, the other will be calculated using proportionality.
  • Desired Height:
    desired height of the background image
  • Object Portal Type:
    this is a very important point. You must select here, the portal_type of the object displayed in the form. The update script will be use this Object Portal Type to find the view of the object, delete it, and create the new one.

Object deleted : You must take care, in updating a form with this action, some data will be deleted of your instance :

if object_portal_type_id = Object Portal Type without the spaces so the following files will be removed :

  • object_portal_type_id_view
  • object_portal_type_id_css.css
  • object_portal_type_id_viewobject_portal_type_idAsPdf
  • object_portal_type_id_background*

All deleted files are moved in the portal_trash folder, so it's not completely lost.

Update Module from Scribus file button

It may take one or two minutes. You can see progress in the log files.

Use your updated form

When the update is done, you can create a new form and have your improvements. The old forms created before the update are updated too. But, for example, if you have data in a field my_text_field, and you rename this field in my_text_field_2, the old data will not be displayed in the new field.

Troubleshooting

Error: There is more than one result for the view 'testModule_view' : ['portal_skins/test_form_module', 'portal_skins/test_form_module_backup']
That's mean you have another a least two view with the same id 'testModule_view'. You can check this going to http://YOUR_INSTANCE/portal_skins/manage in the "Find" tab and searching the form view id. The solution is to keep only the one you want to use. You can rename the other.

Error: There is no result for the view 'testModule_view'
That's mean that you select a portal type 'test Module' or 'testModule' but there is no view testModule_view. Scribus module create this view automatically, so you may have rename or delete this view. The solution is to rename it again, giving it the name 'testModule_view' or created one in the good portal_skin folder.

Error: portal_skins ' test_form_module' not found
The script which update the Form use the view guessed using the portal type you select to find the portal_skin which contain this view (that's why it must be only one result). If there is only one result and this result is not in portal_skin folder, that's mean you have a big problem, this error might never append.

Related Articles