1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_partner_form_account_peppol" model="ir.ui.view">
<field name="name">res.partner.form.account.peppol</field>
<field name="model">res.partner</field>
<field name="priority">20</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='invoice_sending_method']" position="before">
<field name="available_peppol_sending_methods" invisible="1"/>
<field name="available_peppol_edi_formats" invisible="1"/>
</xpath>
<xpath expr="//field[@name='invoice_sending_method']" position="attributes">
<attribute name="widget">filterable_selection</attribute>
<attribute name="options">{'whitelist_fname': 'available_peppol_sending_methods'}</attribute>
</xpath>
<xpath expr="//field[@name='invoice_edi_format']" position="attributes">
<attribute name="required">invoice_sending_method == 'peppol'</attribute>
<attribute name="widget">filterable_selection</attribute>
<attribute name="options">{'whitelist_fname': 'available_peppol_edi_formats'}</attribute>
</xpath>
<xpath expr="//field[@name='peppol_eas']" position="before">
<field name="bank_account_count" invisible="1"/>
<div class="alert alert-warning mb-0"
colspan="2"
role="alert"
invisible="country_code != 'BE' or not is_peppol_edi_format or peppol_eas in (False, '0208')">
The recommended EAS code for Belgium is 0208. The Endpoint should be the Company Registry number.
</div>
<div class="alert alert-warning"
colspan="2"
role="alert"
invisible="peppol_verification_state != 'valid' or country_code">
To generate complete electronic invoices, also set a country for this partner.
</div>
</xpath>
<xpath expr="//field[@name='peppol_endpoint']" position="after">
<field name="is_peppol_edi_format" invisible="1"/>
<field name="peppol_verification_state" invisible="1" force_save="1"/>
<label for="peppol_verification_state"
invisible="not is_peppol_edi_format or not peppol_endpoint"/>
<div class="row"
invisible="not is_peppol_edi_format or not peppol_endpoint">
<div class="col-4">
<field name="peppol_verification_state" readonly="1"/>
</div>
<div class="col-8 pt-0">
<button name="button_account_peppol_check_partner_endpoint"
class="btn btn-secondary"
type="object"
string="Verify"
help="Verify partner's PEPPOL endpoint"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
<record id="partner_action_verify_peppol" model="ir.actions.server">
<field name="name">Verify Peppol</field>
<field name="model_id" ref="account_peppol.model_res_partner"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
for record in records:
record.button_account_peppol_check_partner_endpoint()
</field>
</record>
</odoo>
|