Ajout de nouveau thème pour une publication PDF
#3
Bonjour, et merci de votre reponse. après avoir effectué ces manip j'ai ceci à la selection du thème (dans config>application:facturation) :
'Xhtml2pdfTheme' object has no attribute 'items'

Pour récapituler j'ai procéder ainsi :
1 - depose dans xhtml2pdf > FR > fr_FR de 2 templates
2 - modif du xhtml2pdf.py
avec  comme code :


Code :
FLAVOURS_INFO = {        l10n.FR: {            'fr_FR': {                'cappuccino': Xhtml2pdfTheme(                    verbose_name='.pdf - Xhtml2pdf - Thème Cappuccino (France)',                    # description='...',  # TODO ?                    # TODO: attribute "directory" ?                    templates={                        billing.get_invoice_model():                            'billing/export/xhtml2pdf/FR/fr_FR/cappuccino/invoice.html',                        billing.get_credit_note_model():                            'billing/export/xhtml2pdf/FR/fr_FR/cappuccino/credit_note.html',                        billing.get_quote_model():                            'billing/export/xhtml2pdf/FR/fr_FR/cappuccino/quote.html',                        billing.get_sales_order_model():                            'billing/export/xhtml2pdf/FR/fr_FR/cappuccino/sales_order.html',                        billing.get_template_base_model():                            'billing/export/xhtml2pdf/FR/fr_FR/cappuccino/template.html',                    },                    # TODO: by ContentType ?                    screenshots=['billing/sample_xhtml2pdf.png'],                ),            },        },         'fr_FR': {                'ADT': Xhtml2pdfTheme(                    verbose_name='.pdf - Xhtml2pdf - Thème ADT (France)',                    # description='...',  # TODO ?                    # TODO: attribute "directory" ?                    templates={                        billing.get_invoice_model():                            'billing/export/xhtml2pdf/FR/fr_FR/ADT/invoice.html',                        billing.get_credit_note_model():                            'billing/export/xhtml2pdf/FR/fr_FR/ADT/credit_note.html',                        billing.get_quote_model():                            'billing/export/xhtml2pdf/FR/fr_FR/ADT/quote.html',                        billing.get_sales_order_model():                            'billing/export/xhtml2pdf/FR/fr_FR/ADT/sales_order.html',                        billing.get_template_base_model():                            'billing/export/xhtml2pdf/FR/fr_FR/ADT/template.html',                    },                    # TODO: by ContentType ?                    screenshots=['billing/sample_adt_xhtml2pdf.png'],                ),            }    }


3 - fais un restart cremecrm_job_manager dans putty

Ai je manquer quelque chose ou fais une erreur dans le code ?

Je ne me sert de putty que pour faire un restart cremecrm_job_manager
  Répondre


Messages dans ce sujet
RE: Ajout de nouveau thème pour une publication PDF - par matthieu - 29-09-2021, 11:27

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)