diff --git a/addons/hr_expense/i18n/hr_expense.pot b/addons/hr_expense/i18n/hr_expense.pot index 361716eddeb36821eb362d7505d73e9f590c50bb..711b3ca0da28f76aa44b13d9dd7623acb68b48db 100644 --- a/addons/hr_expense/i18n/hr_expense.pot +++ b/addons/hr_expense/i18n/hr_expense.pot @@ -1802,6 +1802,12 @@ msgstr "" msgid "You cannot refuse your own expenses" msgstr "" +#. module: hr_expense +#: code:addons/hr_expense/models/hr_expense.py:0 +#, python-format +msgid "You cannot report expenses for different companies in the same report." +msgstr "" + #. module: hr_expense #: code:addons/hr_expense/models/hr_expense.py:0 #, python-format diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 85f50be31efbf064b5424a6301e9ea10a0e0e2fc..78106963dbd83b355252fbdee2459c6aeba50dab 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -328,6 +328,8 @@ Or send your receipts at <a href="mailto:%(email)s?subject=Lunch%%20with%%20cust raise UserError(_("You cannot report expenses for different employees in the same report.")) if any(not expense.product_id for expense in self): raise UserError(_("You can not create report without product.")) + if len(self.company_id) != 1: + raise UserError(_("You cannot report expenses for different companies in the same report.")) todo = self.filtered(lambda x: x.payment_mode=='own_account') or self.filtered(lambda x: x.payment_mode=='company_account') sheet = self.env['hr.expense.sheet'].create({ diff --git a/addons/l10n_de/report/din5008_report.xml b/addons/l10n_de/report/din5008_report.xml index 222c10d17b3213ab0d87f0e017f118cb1918caa3..f1ab87231c163aaea6dfb2acb7826b4adc9b6575 100644 --- a/addons/l10n_de/report/din5008_report.xml +++ b/addons/l10n_de/report/din5008_report.xml @@ -40,7 +40,7 @@ <!-- New report layout for din5008 format --> <template id="external_layout_din5008"> <div> - <div t-attf-class="header din_page o_company_#{company.id}_layout"> + <div t-attf-class="header din_page o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' else ''}"> <table class="company_header" t-att-style="'height: %dmm;' % (din_header_spacing or 27)"> <tr> <td><h3 class="mt0" t-field="company.report_header"/></td> @@ -49,7 +49,7 @@ </table> </div> - <div t-attf-class="din_page invoice_note article o_company_#{company.id}_layout" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id"> + <div t-attf-class="din_page invoice_note article o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' else ''}" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id"> <table> <tr> <td> @@ -116,7 +116,7 @@ <t t-raw="0"/> </div> - <div t-attf-class="din_page footer o_company_#{company.id}_layout"> + <div t-attf-class="din_page footer o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' else ''}"> <div class="text-right page_number"> <div class="text-muted"> Page: <span class="page"/> of <span class="topage"/> @@ -126,7 +126,7 @@ <table> <tr> <td> - <ul class="list-inline"> + <ul class="list-inline text-nowrap"> <li t-if="company.name"><span t-field="company.name"/></li> <li t-if="company.street"><span t-field="company.street"/></li> <li t-if="company.street2"><span t-field="company.street2"/></li> diff --git a/addons/l10n_de/static/src/scss/report_din5008.scss b/addons/l10n_de/static/src/scss/report_din5008.scss index 10bd7b6bedcc3527f27d3d15eadbdb83151a3440..fe17ff336a4d869927c6ed583cf0821486810d6c 100644 --- a/addons/l10n_de/static/src/scss/report_din5008.scss +++ b/addons/l10n_de/static/src/scss/report_din5008.scss @@ -1,5 +1,4 @@ .din_page { - margin-left: -1rem; font-size: 9pt; &.header { @@ -22,7 +21,6 @@ } &.invoice_note { - padding-top: 20px; tr { td { vertical-align: bottom; @@ -110,6 +108,11 @@ } } +.din_page_pdf { + width: 180mm; + margin-left: -1rem; +} + // TODO WAN remove in master .din {