Skip to content

Commit

Permalink
adapt to agreement 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Apr 2, 2015
1 parent 23d7750 commit ffa37e8
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 45 deletions.
2 changes: 1 addition & 1 deletion framework_agreement_department/__openerp__.py
Expand Up @@ -23,7 +23,7 @@
"license": "AGPL-3",
'website': 'http://camptocamp.com',
'depends': ['framework_agreement', 'hr'],
'data': ['view/agreement.xml',
'data': ['view/pricelist.xml',
'view/portfolio.xml'],
'installable': True,
}
4 changes: 2 additions & 2 deletions framework_agreement_department/model/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA (http://www.camptocamp.com)
# Copyright 2014-2015 Camptocamp SA (http://www.camptocamp.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
Expand All @@ -15,5 +15,5 @@
# You should have received a copy of the GNU Affero General Public Lice
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from . import agreement
from . import pricelist
from . import portfolio
25 changes: 25 additions & 0 deletions framework_agreement_department/model/pricelist.py
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA (http://www.camptocamp.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 Lice
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from openerp import models, fields


class Pricelist(models.Model):
_inherit = 'product.pricelist'

department_id = fields.Many2one('hr.department', 'Department',
related='portfolio_id.department_id')
42 changes: 0 additions & 42 deletions framework_agreement_department/view/agreement.xml

This file was deleted.

40 changes: 40 additions & 0 deletions framework_agreement_department/view/pricelist.xml
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="product_pricelist_view_tree" model="ir.ui.view">
<field name="name">product_pricelist_view_tree</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="framework_agreement.product_pricelist_view_tree" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="department_id" />
</field>
</field>
</record>

<record id="product_pricelist_view" model="ir.ui.view">
<field name="name">product_pricelist_view</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="framework_agreement.product_pricelist_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="department_id" />
</field>
</field>
</record>

<record id="product_pricelist_view_search" model="ir.ui.view">
<field name="name">product_pricelist_view_search</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="framework_agreement.product_pricelist_view_search" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="department_id"/>
<filter string="Department" context="{'group_by':'department_id'}"/>
</field>
</field>
</record>

</data>
</openerp>

0 comments on commit ffa37e8

Please sign in to comment.