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 ""
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
......
......@@ -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({
......
......@@ -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>
......
.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 {
......
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