Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7647 Lượt xem

I'm trying to customize odoo invoice report firts thing had tried to do is to hide the partner details form the top left of the page this how it wrote in the original report

<template id="report_invoice_document">
<
t t-call="web.external_layout">
<
t t-set="o" t-value="o.with_context(lang=lang)" />
<
t t-set="address">
<
address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<
div t-if="o.partner_id.vat" class="mt16"><t t-esc="o.company_id.country_id.vat_label or 'Tax ID'"/>
:
<
span t-field="o.partner_id.vat"/>
</
div>
</
t>

then I'm tried to hide and it work partially because the partner name still appear this what I had done

<odoo>
<data>
    <template id="test_inherit"  inherit_id="account.report_invoice_document" >
            <xpath expr="//t[@t-set='address']/address"  position="attributes">
            <attribute name="t-options"></attribute>
        </xpath>
</data>
</odoo>

his hide the address but not the partner name any help will be appreciated
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Please try like below

<xpath expr="//t[@t-set='address']"  position="replace"></xpath>

Regards

Ảnh đại diện
Huỷ bỏ
Tác giả

Cybrosys is The Best 👍

Câu trả lời hay nhất

Hello Mohamed Fouad,
Hope you are doing well

Please find code in comment.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

Hide Partner name and address from invoice report the code below.

<template id="inherit_report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr ="//t[@t-set='address']/address[@t-field='o.partner_id']" position ="replace"></xpath>
</template>

or

<template id="inherit_report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr ="//t[@t-set='address']" position ="replace"></xpath>
</template>

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 1 20
8008
1
thg 7 20
4167
1
thg 3 15
5461
2
thg 9 24
1855
0
thg 3 24
974