filtre ressources liées aux produits

This commit is contained in:
eloyoussef 2018-04-06 14:38:30 +02:00
parent fa635b496e
commit 53e28fec61
4 changed files with 65 additions and 3 deletions

View File

@ -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']
}

View File

@ -19,4 +19,5 @@
from . import golem_resource_type, \
golem_resource_timetable, \
golem_resource, \
golem_resource_reservation
golem_resource_reservation, \
product_template

View 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')

View 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>