diff --git a/models/account_invoice.py b/models/account_invoice.py index 16c9033bad0656caeb6ce5001b49d05ac5defe78..4396b6bef653a8647036fef1a7aae02e8457ee69 100755 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -45,6 +45,10 @@ class ScopAccountInvoice(models.Model): related='partner_id.ur_id', store=True ) + partner_member_number = fields.Char( + string='N° Adhérent', + related='partner_id.member_number', + ) contribution_id = fields.Many2one( comodel_name='scop.contribution', string='Ligne de cotisation') diff --git a/views/account_invoice.xml b/views/account_invoice.xml index a63f1185a143f58a80bb6ae883605716365142b6..4bf583310e63172aac06a00c2ce1090d3e96d588 100644 --- a/views/account_invoice.xml +++ b/views/account_invoice.xml @@ -24,6 +24,9 @@ <xpath expr="//field[@name='partner_id']" position="attributes"> <attribute name="string">Adhérent</attribute> </xpath> + <xpath expr="//field[@name='partner_id']" position="after"> + <field name="partner_member_number" readonly="1"/> + </xpath> <xpath expr="//field[@name='date_invoice']" position="attributes"> <attribute name="string">Date de cotisation</attribute> </xpath> @@ -59,7 +62,9 @@ <field name="mode">primary</field> <field name="inherit_id" ref="account.invoice_tree_with_onboarding"/> <field name="arch" type="xml"> - + <xpath expr="//field[@name='partner_id']" position="before"> + <field name="partner_member_number" readonly="1"/> + </xpath> <xpath expr="//field[@name='partner_id']" position="attributes"> <attribute name="string">Adhérent</attribute> </xpath>