[FIX]GOLEM Season : fix season_id field, in conflict with inherited season_id from golem.activity
This commit is contained in:
parent
61035a9fb2
commit
23a52fe1ea
@ -22,7 +22,7 @@
|
||||
- add season with name and period ;
|
||||
- choose on per default season ;
|
||||
- link optionnally one or many memberships types''',
|
||||
'version': '10.0.1.1.0',
|
||||
'version': '10.0.1.1.1',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-28 07:38+0000\n"
|
||||
"PO-Revision-Date: 2018-02-28 07:38+0000\n"
|
||||
"POT-Creation-Date: 2018-03-06 07:14+0000\n"
|
||||
"PO-Revision-Date: 2018-03-06 07:14+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -94,8 +94,8 @@ msgid "Last Updated on"
|
||||
msgstr "Dernière mise à jour le"
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_product_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_template_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_product_membership_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_template_membership_season_id
|
||||
msgid "Linked season"
|
||||
msgstr "Saison liée"
|
||||
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-28 07:38+0000\n"
|
||||
"PO-Revision-Date: 2018-02-28 07:38+0000\n"
|
||||
"POT-Creation-Date: 2018-03-06 07:14+0000\n"
|
||||
"PO-Revision-Date: 2018-03-06 07:14+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -94,8 +94,8 @@ msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_product_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_template_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_product_membership_season_id
|
||||
#: model:ir.model.fields,field_description:golem_season.field_product_template_membership_season_id
|
||||
msgid "Linked season"
|
||||
msgstr ""
|
||||
|
||||
|
@ -28,7 +28,7 @@ class GolemSeason(models.Model):
|
||||
_('This season name has already been used.'))]
|
||||
|
||||
name = fields.Char('Season name', copy=False, required=True)
|
||||
membership_ids = fields.One2many('product.template', 'season_id',
|
||||
membership_ids = fields.One2many('product.template', 'membership_season_id',
|
||||
string='Membership types',
|
||||
domain=[('membership', '=', True)])
|
||||
member_counter = fields.Integer('Counter for member number generation',
|
||||
|
@ -23,15 +23,15 @@ class ProductTemplate(models.Model):
|
||||
""" Product Template adaptations """
|
||||
_inherit = 'product.template'
|
||||
|
||||
season_id = fields.Many2one('golem.season', 'Linked season', index=True)
|
||||
membership_season_id = fields.Many2one('golem.season', 'Linked season', index=True)
|
||||
|
||||
@api.onchange('season_id')
|
||||
@api.onchange('membership_season_id')
|
||||
def onchange_season(self):
|
||||
""" Adapts period to selected season if needed """
|
||||
for product in self:
|
||||
if product.membership and product.season_id \
|
||||
if product.membership and product.membership_season_id \
|
||||
and not product.membership_date_from:
|
||||
product.update({
|
||||
'membership_date_from': product.season_id.date_start,
|
||||
'membership_date_to': product.season_id.date_end
|
||||
'membership_date_from': product.membership_season_id.date_start,
|
||||
'membership_date_to': product.membership_season_id.date_end
|
||||
})
|
||||
|
@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="inherit_id" ref="membership.membership_products_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="default_code" position="before">
|
||||
<field name="season_id" options="{'no_create': True}" />
|
||||
<field name="membership_season_id" options="{'no_create': True}" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@ -41,11 +41,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="inherit_id" ref="membership.membership_product_search_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="season_id" />
|
||||
<field name="membership_season_id" />
|
||||
</field>
|
||||
<xpath expr="//group/filter[1]" position="after">
|
||||
<filter name="group_season" string="Season"
|
||||
context="{'group_by': 'season_id'}" />
|
||||
context="{'group_by': 'membership_season_id'}" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
x
Reference in New Issue
Block a user