Skip to content
Snippets Groups Projects
Commit f2540d66 authored by OCA Git Bot's avatar OCA Git Bot
Browse files

Merge remote-tracking branch 'odoo/14.0' into 14.0

parents 43a6702a 96b09395
No related branches found
No related tags found
No related merge requests found
...@@ -1802,6 +1802,12 @@ msgstr "" ...@@ -1802,6 +1802,12 @@ msgstr ""
msgid "You cannot refuse your own expenses" msgid "You cannot refuse your own expenses"
msgstr "" 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 #. module: hr_expense
#: code:addons/hr_expense/models/hr_expense.py:0 #: code:addons/hr_expense/models/hr_expense.py:0
#, python-format #, python-format
......
...@@ -328,6 +328,8 @@ Or send your receipts at <a href="mailto:%(email)s?subject=Lunch%%20with%%20cust ...@@ -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.")) raise UserError(_("You cannot report expenses for different employees in the same report."))
if any(not expense.product_id for expense in self): if any(not expense.product_id for expense in self):
raise UserError(_("You can not create report without product.")) 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') 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({ sheet = self.env['hr.expense.sheet'].create({
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<!-- New report layout for din5008 format --> <!-- New report layout for din5008 format -->
<template id="external_layout_din5008"> <template id="external_layout_din5008">
<div> <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)"> <table class="company_header" t-att-style="'height: %dmm;' % (din_header_spacing or 27)">
<tr> <tr>
<td><h3 class="mt0" t-field="company.report_header"/></td> <td><h3 class="mt0" t-field="company.report_header"/></td>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</table> </table>
</div> </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> <table>
<tr> <tr>
<td> <td>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<t t-raw="0"/> <t t-raw="0"/>
</div> </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-right page_number">
<div class="text-muted"> <div class="text-muted">
Page: <span class="page"/> of <span class="topage"/> Page: <span class="page"/> of <span class="topage"/>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<table> <table>
<tr> <tr>
<td> <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.name"><span t-field="company.name"/></li>
<li t-if="company.street"><span t-field="company.street"/></li> <li t-if="company.street"><span t-field="company.street"/></li>
<li t-if="company.street2"><span t-field="company.street2"/></li> <li t-if="company.street2"><span t-field="company.street2"/></li>
......
.din_page { .din_page {
margin-left: -1rem;
font-size: 9pt; font-size: 9pt;
&.header { &.header {
...@@ -22,7 +21,6 @@ ...@@ -22,7 +21,6 @@
} }
&.invoice_note { &.invoice_note {
padding-top: 20px;
tr { tr {
td { td {
vertical-align: bottom; vertical-align: bottom;
...@@ -110,6 +108,11 @@ ...@@ -110,6 +108,11 @@
} }
} }
.din_page_pdf {
width: 180mm;
margin-left: -1rem;
}
// TODO WAN remove in master // TODO WAN remove in master
.din { .din {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment