Sale Blanket Order

Report Blanketorder Document

ID: mint_system.sale_blanket_order.report_blanketorder_document.add_footer

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

<xpath expr="//table[@id='summary']" position="after">
  <style>
      table#footer {
        width: 100%;
        font-size: 8pt;
      }
      table#footer tr, td {
        vertical-align: top;
      }
    </style>
    <table id='footer'>
      <tr>
        <td width="40%" t-if="doc.payment_term_id.note">Payment terms 
          <span t-field="doc.payment_term_id.note"/>
        </td>
        <td width="60%">
          Delivery according to our general delivery conditions
        </td>
      </tr>
      <tr>
        <td >VAT no: 
           <span t-field="doc.company_id.vat"/>
        </td>
        <td>
          <table width="100%">
          <tr>
            <td width="35%">
               Bank accounts:
            </td>
              <td width="65%">
              UBS AG, 6301 Zug, BLZ 273, SWIFT UBSWCHZH80A
             </td>
          </tr> 
          <tr> 
             <td>
            </td>
            <td>
            (CHF) IBAN CH63 0027 3273 Q978 6962 0
            </td>
          </tr>
       
          <tr>
            <td>
            </td>
            <td>
            (EUR) IBAN CH59 0027 3273 HN10 3698 0
            </td>
          </tr>
          </table> 
        </td>
      </tr>
    </table>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.add_footer.xmlopen in new window

ID: mint_system.sale_blanket_order.report_blanketorder_document.add_header_and_footer_note

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//table[@id='info']" position="after">
    <t t-if="doc.note_header != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="doc.note_header"/>
    </t>
  </xpath>

  <xpath expr="//table[2]" position="after">
    <t t-if="doc.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
      <span class="note" t-field="doc.note_footer"/>
    </t>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.add_header_and_footer_note.xmlopen in new window

Add Infotable

ID: mint_system.sale_blanket_order.report_blanketorder_document.add_infotable

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//h2" position="after">
    <style>
      table#info {
        width: 100%;
        margin-bottom: 25px;
        font-size: 9pt;
        font-family: arial;
      }
        table#info tr {
        line-height: 1.2;
        text-align: left;
      }
        .note {
        font-size: 9pt;
      }
    </style>
    <table id='info'>
      <tr>
        <td width="17%">Date</td>
        <td width="44%">
          <span t-field='doc.date_confirmed' t-options='{ "widget": "date" }'/>
        </td>
        <td width="14%"></td>
        <td width="25%"></td>
      </tr>
      <tr>
        <td>Customer No.</td>
        <td>
          <span t-field='doc.partner_id.ref'/>
        </td>
        <td>Our Reference</td>
        <td>
          <span t-field='doc.user_id'/>
        </td>
      </tr>
      <tr>
        <td>Order</td>
        <td>
          <span t-field='doc.client_order_ref'/>
        </td>
        <td>Delivery Method</td>
        <td>
          <span t-field='doc.carrier_id'/>
        </td>
      </tr>
      <tr>
        <td>Reference</td>
        <td>
          <span t-field='doc.comment'/>
        </td>
        <td>Incoterm</td>
        <td>
          <span t-field='doc.incoterm'/>
        </td>
      </tr>
    </table>

  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.add_infotable.xmlopen in new window

Address Block

ID: mint_system.sale_blanket_order.report_blanketorder_document.address_block

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">>

  <xpath expr="/t/t/div/div[2]" position="replace">
    <t t-set="address">
            <div t-field="doc.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
            <p t-if="doc.partner_id.vat"><t t-esc="doc.company_id.country_id.vat_label or 'Tax ID'"/>: <span t-field="doc.partner_id.vat"/></p>
        </t>
        <t t-if="doc.partner_shipping_id == doc.partner_invoice_id                              and doc.partner_invoice_id != doc.partner_id                              or doc.partner_shipping_id != doc.partner_invoice_id">
            <t t-set="information_block"> 
                <!--
                <strong t-if="doc.partner_shipping_id == doc.partner_invoice_id">Invoicing and Shipping Address:</strong>
                <strong t-if="doc.partner_shipping_id != doc.partner_invoice_id">Invoicing Address:</strong>
                <div t-field="doc.partner_invoice_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
                -->
                <t t-if="doc.partner_shipping_id != doc.partner_invoice_id">
                    <strong>Shipping Address:</strong>
                    <div t-field="doc.partner_shipping_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
                </t>
            </t>
        </t>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.address_block.xmlopen in new window

Format Qty With Decimal

ID: mint_system.sale_blanket_order.report_blanketorder_document.format_qty_with_decimal

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="60">

  <xpath expr="//span[@id='original_uom_qty']" position="replace">
    <t t-if="l.product_uom.id == 1">
      <span id="original_uom_qty" t-field="l.original_uom_qty" t-options="{'widget': 'integer'}"/>
    </t>
    <t t-else="">
      <span id="original_uom_qty" t-field="l.original_uom_qty"/>
    </t>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.format_qty_with_decimal.xmlopen in new window

Format Qty

ID: mint_system.sale_blanket_order.report_blanketorder_document.format_qty

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="60">

	<span id="qty" position="attributes">
		<attribute name="t-options-widget">"integer"</attribute>
	</span>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.format_qty.xmlopen in new window

Get Position

ID: mint_system.sale_blanket_order.report_blanketorder_document.get_position

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//table/thead/tr/th[1]" position="before">
    <th id="position">
      <span>Pos</span>
    </th>
  </xpath>
  <xpath expr="//table/tbody//tr/td[1]" position="before">
    <td id="position">
      <span>0</span>
    </td>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.get_position.xmlopen in new window

Modify Information Block

ID: mint_system.sale_blanket_order.report_blanketorder_document.modify_information_block

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">
  
   <xpath expr="//table[2]/thead//th[3]" position="replace">
   </xpath>
    <xpath expr="//table[2]/thead//th[4]" position="after">
       <th class="text-center">Unit Price</th>
   </xpath>
   
   <xpath expr="//table[2]/tbody//td[3]" position="replace">
   </xpath>
    <xpath expr="//table[2]/tbody//td[4]" position="after">
        <td class="text-right">
          <span t-field="l.price_unit"/>
        </td>
   </xpath>
   
</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.modify_information_block.xmlopen in new window

Relocate Price Unit

ID: mint_system.sale_blanket_order.report_blanketorder_document.relocate_price_unit

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">
  
   <xpath expr="//table[2]/thead//th[3]" position="replace">
   </xpath>
    <xpath expr="//table[2]/thead//th[4]" position="after">
       <th class="text-center">Unit Price</th>
   </xpath>
   
   <xpath expr="//table[2]/tbody//td[3]" position="replace">
   </xpath>
    <xpath expr="//table[2]/tbody//td[4]" position="after">
        <td class="text-right">
          <span t-field="l.price_unit"/>
        </td>
   </xpath>
   
</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.relocate_price_unit.xmlopen in new window

Remove Informations

ID: mint_system.sale_blanket_order.report_blanketorder_document.remove_informations

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//div[@id='informations']" position="replace">
  </xpath>
    
</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.remove_informations.xmlopen in new window

Replace Product Description

ID: mint_system.sale_blanket_order.report_blanketorder_document.replace_product_description

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">>

<xpath expr="//span[@t-field='l.product_id']" position="replace">
  <t t-if="l.product_id.type_description">
		<span style="font-weight: bold" t-field="l.product_id.type_description"/>
  </t>
  <t t-if="not l.product_id.type_description">
    <span t-field="l.name"/>
  </t>

</xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.replace_product_description.xmlopen in new window

Replace Summary

ID: mint_system.sale_blanket_order.report_blanketorder_document.replace_summary

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//div[2]" position="replace">

     <table id="summary" class="table table-condensed trimada table-borderless" style="margin-top:20px; width:100%; color:black; font-family: arial; font-size:9pt; border-top-style:solid; border-bottom-style:solid; border-width:1px; border-color:black">
      <tr>
        <td style="width:15.5%; text-align:left">
          <strong>Subtotal</strong>
        </td>
        <td style="width:23%; text-align:left">
          <span t-field="doc.amount_untaxed" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.currency_id}"/>
        </td>
        <td style="width:12%; text-align:left">
          <span>VAT 7.7%</span>
        </td>
        <td style="width:17%; text-align:left">
          <span t-field="doc.amount_tax" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.currency_id}"/>
        </td>
        <td style="width:14%; text-align:right">
          <strong>Total</strong>
        </td>
        <td style="width:18%; text-align:right">
          <span t-field="doc.amount_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.currency_id}"/>
        </td>
      </tr>
    </table>

  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.replace_summary.xmlopen in new window

Round Price

ID: mint_system.sale_blanket_order.report_blanketorder_document.round_price

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//span[@t-field='l.price_unit']" position="replace">
		 <span t-esc="'%g' % l.price_unit if str(l.price_unit)[::-1].find('.') >= 3 else '%.2f' % l.price_unit"/>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.round_price.xmlopen in new window

Round Total Price

ID: mint_system.sale_blanket_order.report_blanketorder_document.round_total_price

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//span[@t-field='l.price_subtotal']" position="replace">
    <span t-esc="'{0:,.2f}'.format(float(l.price_subtotal)).replace(',','\'')"/>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.round_total_price.xmlopen in new window

Second Row

ID: mint_system.sale_blanket_order.report_blanketorder_document.second_row

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//tbody[hasclass('sale_tbody')]/t/tr[1]" position="attributes">
    <attribute name="t-att-class">"first"</attribute>
  </xpath>

  <xpath expr="//tbody[hasclass('sale_tbody')]/t/tr[1]" position="after">
    <t t-if="l.product_id.type_description">
    <tr class="second">
      <td></td>
      <td colspan="6">
        <span t-field="l.name"/><br/>
        <t t-if="l.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="l.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="l.product_id.hs_code">
          / Zollposition:
          <span t-field="l.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
    <t t-if="not l.product_id.type_description">
    <tr class="second">
      <td></td>
      <td colspan="6">
        <t t-if="l.product_id.country_of_origin_id.code">
          Ursprungsland:
          <span t-field="l.product_id.country_of_origin_id.code" />
        </t>
        <t t-if="l.product_id.hs_code">
          / Zollposition:
          <span t-field="l.product_id.hs_code" />
        </t>
      </td>
    </tr>
    </t>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.second_row.xmlopen in new window

Set Ids

ID: mint_system.sale_blanket_order.report_blanketorder_document.set_ids

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

    <xpath expr="//table//th[4]" position="attributes">
		<attribute name="id">original_uom_qty</attribute>
	</xpath>

	<xpath expr="//span[@t-field='l.original_uom_qty']" position="attributes">
		<attribute name="id">original_uom_qty</attribute>
	</xpath>

	<!--
	<xpath expr="//table[2]//th[1]" position="attributes">
		<attribute name="id">default_code</attribute>
	</xpath>

  	<xpath expr="//table[2]//th[2]" position="attributes">
		<attribute name="id">description</attribute>
	</xpath>	

	<xpath expr="//table[2]//th[3]" position="attributes">
		<attribute name="id">date_schedule</attribute>
	</xpath>
	<xpath expr="//table[2]//td[3]" position="attributes">
		<attribute name="id">date_schedule</attribute>
	</xpath>

	<xpath expr="//table//th[3]" position="attributes">
		<attribute name="id">date_schedule</attribute>
	</xpath>
	<xpath expr="//table//td[3]" position="attributes">
		<attribute name="id">date_schedule</attribute>
	</xpath>

	<xpath expr="//table[2]//th[4]" position="attributes">
		<attribute name="id">original_uom_qty</attribute>
	</xpath>
	<xpath expr="//table[2]//td[4]/span" position="attributes">
		<attribute name="id">qty</attribute>
	</xpath>

	<xpath expr="//table[2]//th[5]" position="attributes">
		<attribute name="id">price_subtotal</attribute>
	</xpath>
	
	<xpath expr="//table[2]//th[6]" position="attributes">
		<attribute name="id">price_total</attribute>
	</xpath>
	-->

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.set_ids.xmlopen in new window

Show Default Code

ID: mint_system.sale_blanket_order.report_blanketorder_document.show_default_code

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//table[2]/thead/tr/th[1]" position="before">
    <th id="default_code">
      <strong >Part No.</strong>
    </th>
  </xpath>

  <xpath expr="//table[2]/tbody/t/tr/td[1]" position="before">
    <td id="default_code">
      <span t-field="l.product_id.default_code"/>
    </td>
  </xpath>

</data>



Source: snippets/sale_blanket_order.report_blanketorder_document.show_default_code.xmlopen in new window

Show Description

ID: mint_system.sale_blanket_order.report_blanketorder_document.show_description

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">

  <xpath expr="//table/thead/tr/th[1]" position="after">
    <th id="name">
      <span>Description</span>
    </th>
  </xpath>
  <xpath expr="//table/tbody//tr/td[1]" position="after">
    <td>
      <span t-field="l.name"/>
    </td>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.show_description.xmlopen in new window

Style Trimada

ID: mint_system.sale_blanket_order.report_blanketorder_document.style_trimada

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="60">

  <xpath expr="//div[hasclass('page')]" position="before">
		<style>
			.o_company_1_layout {
				font-family: Arial;
				font-size: 9pt;
			}
			.table th {
				padding: 0.3rem;
			}
			.table td {
				padding: 0.3rem;
			}
			h2 {
				font-size: 13pt;
				font-weight: bold;
			}
			table.trimada thead tr {
				border-top:solid 1px;
				border-bottom: solid 1px;
				color: black;
			}
			table.trimada thead th#description {
				width: 70mm;
			}
			table.trimada tr.first td {
				padding-bottom: 0;
			}
			table.trimada tr.second td {
				padding-top: 0;
			}
			table.trimada tr.second {
				border-bottom: 1px solid rgb(220,220,220);
			}
			table.trimada thead th#default_code {
			  width: 27mm;
			  text-align: left;
			}
			table.trimada thead th#date_schedule {
				text-align: right !important;
			}
			table.trimada tbody td#date_schedule {
				text-align: right !important;
			}
			table.trimada thead th#price_subtotal {
			  text-align: right !important;
			}
			table.trimada tbody td span#qty {
			  font-weight: bold;
			}
		</style>
	</xpath>

	<xpath expr="//table[2]" position="attributes">
		<attribute name="class" separator=" " add="trimada table-borderless"/>
	</xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.style_trimada.xmlopen in new window

Title Margin

ID: mint_system.sale_blanket_order.report_blanketorder_document.title_margin

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.report_blanketorder_document" priority="50">>

  <xpath expr="//h2" position="attributes">
    <attribute name="style" separator=";" add="margin-top:10mm; margin-bottom:3mm;"/>
  </xpath>

</data>

Source: snippets/sale_blanket_order.report_blanketorder_document.title_margin.xmlopen in new window

View Blanket Order Form

Modify Attributes Date Order

ID: mint_system.sale_blanket_order.view_blanket_order_form.modify_attributes_date_order

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.view_blanket_order_form" priority="50">

  <xpath expr="//field[@name='date_confirmed']" position="attributes">
      <attribute name="attrs">{"invisible": [["state","in",["cancel"]]], "readonly": [["state","in",["cancel"]]], "required": [["state","in",["sent", "open","done", "expired"]]]}</attribute>
  </xpath>

</data>

Source: snippets/sale_blanket_order.view_blanket_order_form.modify_attributes_date_order.xmlopen in new window

Replace Filter

ID: mint_system.sale_blanket_order.view_blanket_order_search.replace_filter

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.view_blanket_order_search" priority="50">

  <xpath expr="/search" position="replace">
    <search>

      <!-- Filter -->
      <filter name="my_orders" string="Meine Aufträge" domain="[('user_id', '=', uid)]"/>
      <filter string="Meine Aufträge in Arbeit" name="in_progress" domain="['&amp;',('user_id', '=', uid),('state', 'in', ('draft','sent', 'open', 'expired'))]"/>
      <separator/>
      <filter string="Entwurf" name="filter_state_draft" domain="[('state', '=', 'draft')]"/>
      <filter string="Gesendet" name="filter_state_sent" domain="[('state', '=', 'sent')]"/>
      <filter string="Offen" name="filter_state_open" domain="[('state', '=', 'open')]"/>
      <filter string="Erledigt" name="filter_state_erledigt" domain="[('state', '=', 'done')]"/>
      <filter string="Abgelaufen" name="filter_state_expired" domain="[('state', '=', 'expired')]"/>
      <filter string="Abgebrochen" name="filter_state_cancel" domain="[('state', '=', 'cancel')]"/>
      <separator/>
      <filter string="Auftragsdatum" name="filter_date_confirmed" date="date_confirmed"/>

      <!-- Gruppierung -->
      <filter string="Verkäufer" name="user_id" domain="[]" context="{'group_by': 'user_id'}"/>
      <filter string="Kunde" name="partner_id" domain="[]" context="{'group_by': 'partner_id'}"/>
      <filter string="Auftragsdatum" name="date_confirmed" domain="[]" context="{'group_by': 'date_confirmed'}"/>
      <filter string="Status" name="state" domain="[]" context="{'group_by': 'state'}"/>

      <!-- Suche -->
      <group>
        <field name="name" string="Auftrag"/>
        <field name="partner_id"/>
        <field name="user_id"/>
        <field name="team_id"/>
        <field name="product_id" filter_domain="['|','|',('line_ids.product_id', 'ilike', self),('line_ids.product_id.type_description', 'ilike', self),('line_ids.product_id.type_description2', 'ilike', self)]"/>
        <field name="analytic_account_id" string="Kostenstelle"/>
      </group>

    </search>
  </xpath>

</data>

Source: snippets/sale_blanket_order.view_blanket_order_search.replace_filter.xmlopen in new window

View Blanket Order Tree

Reset View

ID: mint_system.sale_blanket_order.view_blanket_order_tree.reset_view

<?xml version="1.0"?>
<data inherit_id="sale_blanket_order.view_blanket_order_tree" priority="50">

  <xpath expr="//tree" position="attributes">
    <attribute name="default_order">id desc</attribute>
  </xpath>
  <xpath expr="//field[@name='partner_id']" position="replace">
  </xpath>
  <xpath expr="//field[@name='validity_date']" position="replace">
  </xpath>
  <xpath expr="//field[@name='user_id']" position="replace">
  </xpath>

  <field name="name" position="after">
    <field name="date_confirmed" />
    <field name="partner_id"/>
    <field name="client_order_ref"/>
    <field name="comment"/>
    <field name="user_id" widget="many2one_avatar_user"/>
    <field name="validity_date"/>
    <field name="amount_total" widget="monetary" decoration-bf="1"/>
  </field>

</data>

Source: snippets/sale_blanket_order.view_blanket_order_tree.reset_view.xmlopen in new window