filtre ressources liées aux produits
This commit is contained in:
parent
fa635b496e
commit
53e28fec61
@ -20,7 +20,7 @@
|
||||
'name': 'GOLEM non-profit resources',
|
||||
'summary': 'GOLEM resources management',
|
||||
'description': ''' GOLEM resources management ''',
|
||||
'version': '10.0.1.13.1',
|
||||
'version': '10.0.1.13.2',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Youssef El Ouahby, Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
@ -32,5 +32,6 @@
|
||||
'views/golem_resource_reservation_views.xml',
|
||||
'views/golem_resource_timetable_views.xml',
|
||||
'wizard/golem_reservation_rejection_views.xml',
|
||||
'security/ir.model.access.csv']
|
||||
'security/ir.model.access.csv',
|
||||
'views/product_template_views.xml']
|
||||
}
|
||||
|
@ -19,4 +19,5 @@
|
||||
from . import golem_resource_type, \
|
||||
golem_resource_timetable, \
|
||||
golem_resource, \
|
||||
golem_resource_reservation
|
||||
golem_resource_reservation, \
|
||||
product_template
|
||||
|
27
golem_resource/models/product_template.py
Normal file
27
golem_resource/models/product_template.py
Normal file
@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
|
||||
# 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/>.
|
||||
|
||||
""" Product Template """
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
""" Product Template Resource Adaptation """
|
||||
_inherit = "product.template"
|
||||
|
||||
resource_ids = fields.One2many('golem.resource', 'product_tmpl_id')
|
33
golem_resource/views/product_template_views.xml
Normal file
33
golem_resource/views/product_template_views.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
|
||||
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/>.
|
||||
-->
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- search -->
|
||||
<record id="product_template_search_inherit_resource_view" model="ir.ui.view">
|
||||
<field name="name">product.template.inherit.resource.search</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref='product.product_template_search_view' />
|
||||
<field name="arch" type="xml">
|
||||
<filter name="filter_to_sell" position="after">
|
||||
<filter string="Linked To A Resource" name="filter_resource_linked" domain="[('resource_ids','!=',False)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
Loading…
Reference in New Issue
Block a user