Update of Snippets

This commit is contained in:
Kurt Gisler committed 2025-04-23 15:30:36 +02:00
1 parent 97de0b1b6b
commit 7e6a021a69
8 files changed
+133 -15

No files matched your search

@@ -9,7 +9,7 @@
<div class="row">
<div class="col">
<span>Bank/BIC: </span>
<span t-field="o.partner_bank_id.display_name"/>
<span t-field="o.partner_bank_id.bank_id"/>
<br/>
<br/>
</div>
@@ -0,0 +1,107 @@
<data inherit_id="account.report_invoice_document" priority="50">
<xpath expr="//div[@id='informations']" position="replace">
<style>
table#info {
width: 100%;
margin-bottom: 25px;
border: transparent;
}
table#info td {
color: black;
border: transparent;
}
table#info td:last-child {
background-color: transparent;
}
table#info tr {
text-align: top;
}
</style>
<table id="info" style="width: 700px; margin-bottom: 50px">
<tr>
<t t-if="o.invoice_date">
<td width="200px">Invoice Date</td>
<td width="500px">
<span id="invoice_date" t-field="o.invoice_date" t-options="{ &quot;widget&quot;: &quot;date&quot; }"/>
</td>
</t>
</tr>
<tr>
<t t-if="o.ref">
<td>Your Reference</td>
<td>
<span t-field="o.ref"/>
</td>
</t>
</tr>
<!-- Get all sale orders without duplicates -->
<t t-set="sale_orders" t-value="list(set([line.order_id for line in o.invoice_line_ids.sale_line_ids]))"/>
<!-- Store if has sale orders -->
<t t-set="has_sale_orders" t-value="len(sale_orders) &gt; 0"/>
<!-- Store if has multiple sale orders -->
<t t-set="has_multiple_sale_orders" t-value="len(sale_orders) &gt; 1"/>
<!-- Store if has lines without sale orders -->
<t t-set="has_lines_without_sale_orders" t-value="len(o.invoice_line_ids.filtered(lambda l: not l.sale_line_ids)) &gt; 0"/>
<t t-foreach="sale_orders" t-as="sale_order">
<tr t-if="has_sale_orders and sale_order">
<tr>
<t t-if="o.invoice_date">
<td width="200px">Order Reference</td>
<td width="500px">
<span id="sale_order_name" t-esc="sale_order.name"/>
</td>
</t>
</tr>
</tr>
</t>
<tr>
<t t-if="o.partner_id.parent_id">
<td>Your Contact</td>
<td>
<span t-field="o.partner_id.name"/>
</td>
</t>
</tr>
<tr>
<t t-if="o.invoice_incoterm_id">
<td>Incoterm</td>
<td>
<span t-field="o.invoice_incoterm_id"/>
</td>
</t>
</tr>
<tr>
<t t-if="o.invoice_payment_term_id">
<td>Payment terms</td>
<td>
<span t-field="o.invoice_payment_term_id"/>
</td>
</t>
</tr>
<tr>
<t t-if="o.user_id">
<td>Our Contact</td>
<td>
<span t-field="o.user_id"/>
<t t-if="o.user_id.email">
, <span t-field="o.user_id.email"/>
</t>
<t t-if="o.user_id.phone">
, <span t-field="o.user_id.phone"/>
</t>
</td>
</t>
</tr>
</table>
</xpath>
</data>
@@ -0,0 +1,5 @@
<data inherit_id="account.report_invoice_document" priority="60">
<xpath expr="//table[2]" position="attributes">
<attribute name="class">table table-sm o_main_table mt-4</attribute>
</xpath>
</data>
@@ -7,7 +7,7 @@
<field name="model_id" ref="maintenance.model_maintenance_equipment"/>
<field name="name">x_calibrated_until</field>
<field name="store" eval="True"/>
<field name="readonly" eval="False"/>
<field name="readonly" eval="True"/>
<field name="copied" eval="False"/>
<field name="ttype">date</field>
<field name="related">x_last_maintenance_request.x_calibrated_until</field>
@@ -11,10 +11,10 @@
<field name="copied" eval="False"/>
<field name="ttype">many2one</field>
<field name="relation">maintenance.request</field>
<field name="depends">name, maintenance_ids.x_calibrated_until</field>
<field name="depends">maintenance_ids.x_calibrated_until, maintenance_ids.close_date</field>
<field name="compute">for record in self:
last_maintenance = record.maintenance_ids.search([('stage_id.id', 'in', ['3']), ('equipment_id', '=', record.id)], order='schedule_date desc', limit=1)
if last_maintenance and last_maintenance.schedule_date:
last_maintenance = record.maintenance_ids.search([('stage_id.id', 'in', ['3']), ('equipment_id', '=', record.id)], order='close_date desc', limit=1)
if last_maintenance and last_maintenance.close_date:
record['x_last_maintenance_request'] = last_maintenance.id
else:
record['x_last_maintenance_request'] = None</field>
@@ -1,14 +1,18 @@
<data inherit_id="purchase.purchase_order_form" priority="50">
<xpath expr="//field[@name='date_order']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
<xpath expr="//field[@name='date_approve']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
<xpath expr="//tree/field[@name='date_planned']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
<xpath expr="//div/field[@name='date_planned']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
</data>
@@ -2,19 +2,19 @@
<xpath expr="//h2" position="after">
<div id="infoblock" class="row mt32 mb32">
<div t-if="o.user_id" class="col-3 bm-2">
<strong>Ansprechperson Einkauf</strong>
<strong>Buyer</strong>
<p t-field="o.user_id.email" class="m-0"/>
</div>
<div class="col-2 bm-2">
<strong>Datum</strong>
<strong>Date</strong>
<p t-field="o.write_date" class="m-0" t-options="{ &quot;widget&quot;: &quot;date&quot; }"/>
</div>
<div t-if="o.partner_ref" class="col-3 bm-2">
<strong>Ihre Referenz</strong>
<strong>Your Order Reference</strong>
<p t-field="o.partner_ref" class="m-0"/>
</div>
<div t-if="o.date_order" class="col-3 bm-2">
<strong>Frist für Angebotsabgabe</strong>
<strong>Deadline for submission of offer</strong>
<p t-field="o.date_order" class="m-0" t-options="{ &quot;widget&quot;: &quot;date&quot; }"/>
</div>
<div t-if="o.incoterm_id" class="col-3 bm-2">
@@ -3,9 +3,11 @@
<attribute name="widget">date</attribute>
</xpath>
<xpath expr="//div/field[@name='commitment_date']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='commitment_date']" position="attributes">
<attribute name="widget">date</attribute>
<attribute name="options">{"show_time":false}</attribute>
<attribute name="widget">datetime</attribute>
</xpath>
</data>