[REF][FIX]GOLEM Member Minor : membership invoice on legal guardians
* Small refacorings ; * Better require for legal guardian when minor ; * Adaptations to new legal guardians ; * Fix on last invoice gathering.
This commit is contained in:
parent
d057579378
commit
3dcdd23d90
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
|
# Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
@ -15,4 +15,4 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from . import models
|
from . import models, wizard
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'GOLEM members minor',
|
'name': 'GOLEM members minor',
|
||||||
'summary': 'GOLEM non-profit members minor management',
|
'summary': 'GOLEM non-profit members minor management',
|
||||||
'version': '10.0.1.2.0',
|
'version': '10.0.1.3.0',
|
||||||
'category': 'GOLEM',
|
'category': 'GOLEM',
|
||||||
'author': 'Fabien Bourgeois',
|
'author': 'Fabien Bourgeois',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
@ -28,6 +28,6 @@
|
|||||||
'depends': ['golem_member'],
|
'depends': ['golem_member'],
|
||||||
'data': ['security/ir.model.access.csv',
|
'data': ['security/ir.model.access.csv',
|
||||||
'views/golem_member_views.xml',
|
'views/golem_member_views.xml',
|
||||||
'views/golem_membership_invoice.xml',
|
'views/account_invoice.xml',
|
||||||
'views/account_invoice.xml']
|
'wizard/golem_membership_invoice.xml']
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 10.0\n"
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-10-24 05:59+0000\n"
|
"POT-Creation-Date: 2018-10-25 15:51+0000\n"
|
||||||
"PO-Revision-Date: 2018-10-24 08:01+0200\n"
|
"PO-Revision-Date: 2018-10-25 17:52+0200\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -30,6 +30,11 @@ msgstr "Peut quitter la structure seul?"
|
|||||||
msgid "Complete Address"
|
msgid "Complete Address"
|
||||||
msgstr "Adresse complète"
|
msgstr "Adresse complète"
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_account_invoice_partner_ids
|
||||||
|
msgid "Concerned partners"
|
||||||
|
msgstr "Contacts concernés"
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_create_uid
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_create_uid
|
||||||
msgid "Created by"
|
msgid "Created by"
|
||||||
@ -60,11 +65,21 @@ msgstr "GOLEM Legal Guardian Management"
|
|||||||
msgid "GOLEM Member"
|
msgid "GOLEM Member"
|
||||||
msgstr "Usager"
|
msgstr "Usager"
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model,name:golem_member_minor.model_golem_membership_invoice
|
||||||
|
msgid "GOLEM MemberShip invoicing"
|
||||||
|
msgstr "Facturation de l'adhésion"
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_id
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_id
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr "ID"
|
msgstr "ID"
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model,name:golem_member_minor.model_account_invoice
|
||||||
|
msgid "Invoice"
|
||||||
|
msgstr "Facture"
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.ui.view,arch_db:golem_member_minor.golem_member_search_inherit_minor
|
#: model:ir.ui.view,arch_db:golem_member_minor.golem_member_search_inherit_minor
|
||||||
msgid "Is adult"
|
msgid "Is adult"
|
||||||
@ -80,8 +95,14 @@ msgstr "Par défaut"
|
|||||||
msgid "Is minor"
|
msgid "Is minor"
|
||||||
msgstr "Est mineur"
|
msgstr "Est mineur"
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_account_invoice_is_minor_invoice
|
||||||
|
msgid "Is minor invoice"
|
||||||
|
msgstr "Facture sur mineur"
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_member_is_minor
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_member_is_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_membership_invoice_src_member_minor
|
||||||
msgid "Is minor?"
|
msgid "Is minor?"
|
||||||
msgstr "Est mineur?"
|
msgstr "Est mineur?"
|
||||||
|
|
||||||
@ -102,6 +123,7 @@ msgstr "Dernière mise à jour le"
|
|||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_legal_guardian_id
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_legal_guardian_id
|
||||||
|
#: model:ir.ui.view,arch_db:golem_member_minor.golem_membership_invoice_form_inherit
|
||||||
msgid "Legal guardian"
|
msgid "Legal guardian"
|
||||||
msgstr "Représentant légal"
|
msgstr "Représentant légal"
|
||||||
|
|
||||||
@ -130,6 +152,11 @@ msgstr "Mobile"
|
|||||||
msgid "Phone"
|
msgid "Phone"
|
||||||
msgstr "Téléphone"
|
msgstr "Téléphone"
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_membership_invoice_src_member_id
|
||||||
|
msgid "Src member id"
|
||||||
|
msgstr "Usager"
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: code:addons/golem_member_minor/models/golem_legal_guardian.py:29
|
#: code:addons/golem_member_minor/models/golem_legal_guardian.py:29
|
||||||
#: sql_constraint:golem.legal.guardian:0
|
#: sql_constraint:golem.legal.guardian:0
|
||||||
@ -138,7 +165,7 @@ msgid "There are doubles in your legal guardians. Please check your fills."
|
|||||||
msgstr "Il y a des doublons au niveau des représentants légaux. Merci de vérifier vos saisies."
|
msgstr "Il y a des doublons au niveau des représentants légaux. Merci de vérifier vos saisies."
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: code:addons/golem_member_minor/models/golem_member.py:65
|
#: code:addons/golem_member_minor/models/golem_member.py:76
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "You must have one and only one default legal guardian. Please check your fills."
|
msgid "You must have one and only one default legal guardian. Please check your fills."
|
||||||
msgstr "Vous ne pouvez avoir qu'un et un seul représentant légal par défaut. Merci de vérifier vos saisies."
|
msgstr "Vous ne pouvez avoir qu'un et un seul représentant légal par défaut. Merci de vérifier vos saisies."
|
||||||
|
@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 10.0\n"
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-10-24 05:59+0000\n"
|
"POT-Creation-Date: 2018-10-25 15:51+0000\n"
|
||||||
"PO-Revision-Date: 2018-10-24 05:59+0000\n"
|
"PO-Revision-Date: 2018-10-25 15:51+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -30,6 +30,11 @@ msgstr ""
|
|||||||
msgid "Complete Address"
|
msgid "Complete Address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_account_invoice_partner_ids
|
||||||
|
msgid "Concerned partners"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_create_uid
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_create_uid
|
||||||
msgid "Created by"
|
msgid "Created by"
|
||||||
@ -60,11 +65,21 @@ msgstr ""
|
|||||||
msgid "GOLEM Member"
|
msgid "GOLEM Member"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model,name:golem_member_minor.model_golem_membership_invoice
|
||||||
|
msgid "GOLEM MemberShip invoicing"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_id
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_id
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model,name:golem_member_minor.model_account_invoice
|
||||||
|
msgid "Invoice"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.ui.view,arch_db:golem_member_minor.golem_member_search_inherit_minor
|
#: model:ir.ui.view,arch_db:golem_member_minor.golem_member_search_inherit_minor
|
||||||
msgid "Is adult"
|
msgid "Is adult"
|
||||||
@ -80,8 +95,14 @@ msgstr ""
|
|||||||
msgid "Is minor"
|
msgid "Is minor"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_account_invoice_is_minor_invoice
|
||||||
|
msgid "Is minor invoice"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_member_is_minor
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_member_is_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_membership_invoice_src_member_minor
|
||||||
msgid "Is minor?"
|
msgid "Is minor?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -102,6 +123,7 @@ msgstr ""
|
|||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_legal_guardian_id
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_legal_guardian_legal_guardian_id
|
||||||
|
#: model:ir.ui.view,arch_db:golem_member_minor.golem_membership_invoice_form_inherit
|
||||||
msgid "Legal guardian"
|
msgid "Legal guardian"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -130,6 +152,11 @@ msgstr ""
|
|||||||
msgid "Phone"
|
msgid "Phone"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_member_minor
|
||||||
|
#: model:ir.model.fields,field_description:golem_member_minor.field_golem_membership_invoice_src_member_id
|
||||||
|
msgid "Src member id"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: code:addons/golem_member_minor/models/golem_legal_guardian.py:29
|
#: code:addons/golem_member_minor/models/golem_legal_guardian.py:29
|
||||||
#: sql_constraint:golem.legal.guardian:0
|
#: sql_constraint:golem.legal.guardian:0
|
||||||
@ -138,7 +165,7 @@ msgid "There are doubles in your legal guardians. Please check your fills."
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_member_minor
|
#. module: golem_member_minor
|
||||||
#: code:addons/golem_member_minor/models/golem_member.py:65
|
#: code:addons/golem_member_minor/models/golem_member.py:76
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "You must have one and only one default legal guardian. Please check your fills."
|
msgid "You must have one and only one default legal guardian. Please check your fills."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -16,4 +16,4 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from . import golem_member, golem_membership, account_invoice, golem_legal_guardian
|
from . import golem_member, account_invoice, golem_legal_guardian
|
||||||
|
@ -18,11 +18,12 @@
|
|||||||
|
|
||||||
""" Account Invoice adaptations """
|
""" Account Invoice adaptations """
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields
|
||||||
|
|
||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
""" Account Invoice adaptations """
|
""" Account Invoice adaptations """
|
||||||
_inherit = 'account.invoice'
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
partner_ids = fields.Many2many('res.partner', string="Concerned partners")
|
partner_ids = fields.Many2many('res.partner', string='Concerned partners',
|
||||||
|
auto_join=True)
|
||||||
is_minor_invoice = fields.Boolean()
|
is_minor_invoice = fields.Boolean()
|
||||||
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<!-- Forms -->
|
<!-- Forms -->
|
||||||
<record id="account.invoice_form_inherited_member_minor" model="ir.ui.view">
|
<record id="account.invoice_form_inherited_member_minor" model="ir.ui.view">
|
||||||
<field name="name">account.invoice.form.iherited.member.minor</field>
|
<field name="name">account.invoice.form.iherited.member.minor</field>
|
||||||
@ -27,13 +28,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="inherit_id" ref="account.invoice_form" />
|
<field name="inherit_id" ref="account.invoice_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name='partner_id' position='after'>
|
<field name='partner_id' position='after'>
|
||||||
<field name='is_minor_invoice' invisible="1"/>
|
<field name='is_minor_invoice' invisible="1" />
|
||||||
<field name="partner_ids"
|
<field name="partner_ids" widget="many2many_tags" readonly="1"
|
||||||
widget="many2many_tags"
|
attrs="{'invisible': [('is_minor_invoice', '=', False)]}" />
|
||||||
readonly="1"
|
|
||||||
attrs="{'invisible': [('is_minor_invoice', '=', False)]}"/>
|
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
@ -39,7 +39,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</page>
|
</page>
|
||||||
<xpath expr="//page[@name='membership']/group/group/div/button[1]" position="attributes">
|
<xpath expr="//page[@name='membership']/group/group/div/button[1]"
|
||||||
|
position="attributes">
|
||||||
<attribute name="name">membership_invoice_action</attribute>
|
<attribute name="name">membership_invoice_action</attribute>
|
||||||
<attribute name="type">object</attribute>
|
<attribute name="type">object</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
18
golem_member_minor/wizard/__init__.py
Normal file
18
golem_member_minor/wizard/__init__.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from . import golem_membership_invoice
|
@ -26,30 +26,31 @@ class GolemMembershipInvoice(models.TransientModel):
|
|||||||
_inherit = 'golem.membership.invoice'
|
_inherit = 'golem.membership.invoice'
|
||||||
|
|
||||||
|
|
||||||
src_member_id = fields.Many2one('golem.member')
|
src_member_id = fields.Many2one('golem.member', ondelete='cascade')
|
||||||
partner_id = fields.Many2one(required=True)
|
src_member_minor = fields.Boolean(related='src_member_id.is_minor')
|
||||||
|
|
||||||
@api.onchange('src_member_id')
|
@api.onchange('src_member_id')
|
||||||
def onchange_member(self):
|
def onchange_member(self):
|
||||||
""" Set partner domain if src_member_id is filled """
|
""" Set partner domain if src_member_id is filled """
|
||||||
record = self[0]
|
self.ensure_one()
|
||||||
if record.src_member_id.is_minor:
|
record = self[0]
|
||||||
return {'domain': {'partner_id':
|
domain = ([('id', 'in',
|
||||||
[('id', 'in', record.src_member_id.legal_guardian_ids.ids)]
|
record.src_member_id.mapped('legal_guardian_ids.legal_guardian_id').ids)]
|
||||||
}
|
if record.src_member_id.is_minor else [])
|
||||||
}
|
return {'domain': {'partner_id': domain}}
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def membership_invoice(self):
|
def membership_invoice(self):
|
||||||
""" Add partners concerned to invoice and move membership from legal guardian to minor """
|
""" Add partners concerned to invoice and move membership from legal
|
||||||
|
guardian to minor """
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
record = self[0]
|
record = self[0]
|
||||||
res = super(GolemMembershipInvoice, self).membership_invoice()
|
res = super(GolemMembershipInvoice, self).membership_invoice()
|
||||||
if record.src_member_id and record.src_member_id.is_minor:
|
if record.src_member_id.is_minor:
|
||||||
#gettin invoice_id from action's domain already declared
|
# Getting invoice IDS from action's domain already declared
|
||||||
invoice_id = (res['domain'][0][2] if
|
invoice_ids = (res['domain'][0][2] or False)
|
||||||
res['domain'][0][2] else False)
|
if invoice_ids: # As invoice_ids is a Python list, empty or not
|
||||||
if invoice_id:
|
invoice = self.env['account.invoice'].browse(invoice_ids)[-1]
|
||||||
invoice = self.env['account.invoice'].browse(invoice_id)
|
|
||||||
invoice.is_minor_invoice = True
|
invoice.is_minor_invoice = True
|
||||||
invoice.partner_ids = [(6, 0, [record.partner_id.id,
|
invoice.partner_ids = [(6, 0, [record.partner_id.id,
|
||||||
record.src_member_id.partner_id.id])]
|
record.src_member_id.partner_id.id])]
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<!-- Forms -->
|
<!-- Forms -->
|
||||||
<record id="golem_membership_invoice_form_inherit" model="ir.ui.view">
|
<record id="golem_membership_invoice_form_inherit" model="ir.ui.view">
|
||||||
<field name="name">membership.invoice.view.form_iherit</field>
|
<field name="name">membership.invoice.view.form_iherit</field>
|
||||||
@ -27,12 +28,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="inherit_id" ref="golem_membership.golem_membership_invoice_form" />
|
<field name="inherit_id" ref="golem_membership.golem_membership_invoice_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name='product_id' position='before'>
|
<field name='product_id' position='before'>
|
||||||
<field name='partner_id'
|
<field name='src_member_id' invisible="1" />
|
||||||
attrs="{'invisible': [('src_member_id', '=', False)]}"
|
<field name='src_member_minor' invisible="1" />
|
||||||
options="{'no_create': True}"/>
|
<field name='partner_id' string="Legal guardian"
|
||||||
<field name='src_member_id' invisible="1"/>
|
options="{'no_create': True}"
|
||||||
|
attrs="{'invisible': [('src_member_id', '=', False)], 'required': [('src_member_minor', '=', True)]}" />
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
@ -26,7 +26,8 @@ class GolemMembershipInvoice(models.TransientModel):
|
|||||||
_name = 'golem.membership.invoice'
|
_name = 'golem.membership.invoice'
|
||||||
_description = 'GOLEM MemberShip invoicing'
|
_description = 'GOLEM MemberShip invoicing'
|
||||||
|
|
||||||
partner_id = fields.Many2one('res.partner', 'Partner')
|
partner_id = fields.Many2one('res.partner', 'Partner', required=True,
|
||||||
|
ondelete='cascade')
|
||||||
product_id = fields.Many2one('product.product', 'Membership',
|
product_id = fields.Many2one('product.product', 'Membership',
|
||||||
required=True)
|
required=True)
|
||||||
member_price = fields.Float('Member Price',
|
member_price = fields.Float('Member Price',
|
||||||
|
Loading…
Reference in New Issue
Block a user