Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
5 Відповіді
3754 Переглядів

Has anyone figured out yet how and with which software to add the dynamic fields (like Sale Order Number) to the new v17 PDF quotation builder templates. The documentation does not explain this part. I have tried Libre Office to create a PDF form, making sure the name of the fields were corresponding to the ones mentioned in the docs. It sort of worked, but you could only see the auto populated value in the PDF after clicking on the empty field. And the field remains editable.

So how is this supposed to work? What do we need as software additionally to Odoo to build a template that show the fields populated and uneditable?

Edit: Tested a demo quote on demo.odoo.com for the Large Meeting Table. Downloaded the PDF and opened in Acrobat Reader. The Sales Order Number and Customer name only appear when clicking on the empty field. Also not there on the printed version. But if I open the PDF in Chrome browser it looks fine. This seems to be a PDF issue (lots of hits on Google)

So perhaps Libre Office still is a good way to build a quote template using open source software. So I will be testing some more. Also still need to figure out how to prevent the field from being editable after the PDF is generated.

Аватар
Відмінити
Найкраща відповідь


i solved it with using adobe acrobat pro.
You just need to add a field with this button. Give it the correct name from the docs. And configure it with font/size.
As far as I tested, it only works with the 8 fields mentioned in the documentation of odoo. Other "__" notation are not working.

obd.digital

Аватар
Відмінити
Найкраща відповідь

I’ve developed a module for adding custom fields to the quote builder in Odoo it has a ui and you can search fields to add. If you’re interested in learning more or have any questions, feel free to reach out to me on Discord. My Discord handle is tigor327#1233. Looking forward to connecting!

Аватар
Відмінити

Can't reach u in discord. I want to print the company name instaed the name of the contact person. How to do that?

Найкраща відповідь

Hi! Since I'm not using Adobe Acrobat Pro and the trial is only 7 days - Is there any other software that gives you a possibility to add dynamic fields? I'm not a fan of paying €40 per month to have abilities to change one or two documents for customer ;) 

Аватар
Відмінити
Найкраща відповідь

There are many open source PDF file builders, like html2pdf or fpdf2 and other similar tools.
If you can build a simple HTML page, you can deffinitely build a PDF with dinamic fields. 

Just pick up one that checks the most boxes for your needs.

Аватар
Відмінити
Найкраща відповідь

Hello,
If you want to add custom fields (other than those defined in the docs), you can always update the ' _get_form_fields_mapping' function in the sale_pdf_quote_builder module.

from odoo import models

class IrActionReport(models.Model):
​_inherit = "ir.actions.report"

​def _get_form_fields_mapping(self, order, doc_line_id_mapping=None):
​res = super(IrActionReport, self)._get_form_fields_mapping(order, doc_line_id_mapping)​
​form_fields_mapping = {
​"your_new_field_label": order.your_new_field
​}
​res.update(form_fields_mapping)
​return res




Аватар
Відмінити

Hi Christoph,
THX for that hint. But I can only update the whoole module. Ho to update _get_form_fields_mapping' function?
I want to print the company name instaed the name of the contact person.

Hi @Frank Tanneberger,
I've updated my answer.
You will need to add the function in one of your python file with inherit the ir.action.report class.

Related Posts Відповіді Переглядів Дія
4
трав. 25
2462
2
трав. 25
5801
1
бер. 25
1637
4
бер. 25
4426
3
лют. 25
5413