Skip to content
Snippets Groups Projects
Commit ec90abdd authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[add] partner member fields & view

parent 5afa2b07
No related branches found
No related tags found
No related merge requests found
# Copyright 2021 Le Filament (<http://www.le-filament.com>) # Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import membership_line from . import res_partner
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class MembershipLine(models.Model):
_inherit = 'membership.membership_line'
state = fields.Selection(readonly=False,)
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models, api
class ResPartner(models.Model):
_inherit = 'res.partner'
# Company Fields
membership_number = fields.Integer(string='N° Adhérent')
# ------------------------------------------------------
# SQL Constraints
# ------------------------------------------------------
# ------------------------------------------------------
# Default methods
# ------------------------------------------------------
# ------------------------------------------------------
# Computed fields / Search Fields
# ------------------------------------------------------
# ------------------------------------------------------
# Onchange / Constraints
# ------------------------------------------------------
# ------------------------------------------------------
# CRUD methods (ORM overrides)
# ------------------------------------------------------
# ------------------------------------------------------
# Actions
# ------------------------------------------------------
# ------------------------------------------------------
# Business methods
# ------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Form view -->
<record model="ir.ui.view" id="res_partner_membership_form">
<field name="name">res.partner.membership.form.inherit</field>
<field name="inherit_id" ref="membership.view_partner_form"/>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<xpath expr="//page[@name='membership']" position="attributes">
<attribute name="attrs">{'invisible': [('is_company', '!=', True)]}</attribute>
</xpath>
<xpath expr="//field[@name='free_member']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='free_member']" position="before">
<field name="membership_number"/>
</xpath>
<xpath expr="//button[@name='%(membership.action_membership_invoice_view)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='associate_member']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment