← Back to team overview

savoirfairelinux-openerp team mailing list archive

lp:~savoirfairelinux-openerp/knowledge-addons/7.0-document-page-multi-company into lp:knowledge-addons/7.0

 

Maxime Chambreuil (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/knowledge-addons/7.0-document-page-multi-company into lp:knowledge-addons/7.0.

Requested reviews:
  OpenERP Community Reviewer (openerp-community-reviewer)

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/knowledge-addons/7.0-document-page-multi-company/+merge/182661
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/knowledge-addons/7.0-document-page-multi-company/+merge/182661
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/knowledge-addons/7.0-document-page-multi-company.
=== added directory 'document_page_multi_company'
=== added file 'document_page_multi_company/__init__.py'
--- document_page_multi_company/__init__.py	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/__init__.py	2013-08-28 14:37:46 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#    
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.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/>.  
+#
+##############################################################################
+
+import document_page_multi_company
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'document_page_multi_company/__openerp__.py'
--- document_page_multi_company/__openerp__.py	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/__openerp__.py	2013-08-28 14:37:46 +0000
@@ -0,0 +1,43 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#    
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.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/>.  
+#
+##############################################################################
+
+{
+    'name': 'Document Page Multi-Company',
+    'version': '1.0',
+    "author" : "Savoir-faire Linux",
+    "website" : "http://www.savoirfairelinux.com";,
+    "license" : "AGPL-3",
+    'category': 'Knowledge Management',
+    'description': """
+This module adds a company field to document page and the multi-company rule.
+    """,
+    'depends': [
+        'document_page',
+        ],
+    'data': [
+        'security/document_page_security.xml',
+        'document_page_multi_company_view.xml',
+        ],
+    'installable': True,
+    'auto_install': False,
+    'images': [],
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'document_page_multi_company/document_page_multi_company.py'
--- document_page_multi_company/document_page_multi_company.py	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/document_page_multi_company.py	2013-08-28 14:37:46 +0000
@@ -0,0 +1,43 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#    
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.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 openerp.osv import fields, orm
+
+class document_page_history(orm.Model):
+    _inherit = 'document.page.history'
+    _columns = {
+        'company_id': fields.many2one('res.company', 'Company')
+    }
+
+    _defaults = {
+        'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+    }
+        
+class document_page(orm.Model):
+    _inherit = 'document.page'
+    _columns = {
+        'company_id': fields.many2one('res.company', 'Company')
+    }
+
+    _defaults = {
+        'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+    }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'document_page_multi_company/document_page_multi_company_view.xml'
--- document_page_multi_company/document_page_multi_company_view.xml	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/document_page_multi_company_view.xml	2013-08-28 14:37:46 +0000
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+	<!-- History -->
+
+        <record id="wiki_history_tree_inherit" model="ir.ui.view">
+            <field name="name">document.page.history.tree</field>
+            <field name="model">document.page.history</field>
+            <field name="inherit_id" ref="document_page.view_wiki_history_tree"/>
+            <field name="arch" type="xml">
+                <field name="page_id" position="after">
+                    <field name="company_id" groups="base.group_multi_company"/>
+                </field>
+            </field>
+        </record>
+        
+        <record id="wiki_history_form_inherit" model="ir.ui.view">
+            <field name="name">document.page.history.form</field>
+            <field name="model">document.page.history</field>
+            <field name="inherit_id" ref="document_page.wiki_history_form"/>
+            <field name="arch" type="xml">
+                <field name="create_date" position="after">
+                    <label for="company_id" class="oe_edit_only" groups="base.group_multi_company"/>
+                    <field name="company_id" groups="base.group_multi_company"/>
+                </field>
+            </field>
+        </record>
+        
+	<!-- Page -->
+
+        <record id="wiki_form_inherit" model="ir.ui.view">
+            <field name="name">document.page.form</field>
+            <field name="model">document.page</field>
+            <field name="inherit_id" ref="document_page.view_wiki_form"/>
+            <field name="arch" type="xml">
+                <field name="parent_id" position="after">
+                    <field name="company_id" groups="base.group_multi_company"/>
+                </field>
+            </field>
+        </record>
+        
+        <record id="view_wiki_tree_inherit" model="ir.ui.view">
+            <field name="name">document.page.tree</field>
+            <field name="model">document.page</field>
+            <field name="inherit_id" ref="document_page.view_wiki_tree"/>
+            <field name="arch" type="xml">
+                <field name="write_date" position="after">
+                    <field name="company_id" groups="base.group_multi_company"/>
+                </field>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== added directory 'document_page_multi_company/i18n'
=== added file 'document_page_multi_company/i18n/document_page_multi_company.pot'
--- document_page_multi_company/i18n/document_page_multi_company.pot	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/i18n/document_page_multi_company.pot	2013-08-28 14:37:46 +0000
@@ -0,0 +1,33 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* document_page_multi_company
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-28 14:33+0000\n"
+"PO-Revision-Date: 2013-08-28 14:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: document_page_multi_company
+#: field:document.page,company_id:0
+#: field:document.page.history,company_id:0
+msgid "Company"
+msgstr ""
+
+#. module: document_page_multi_company
+#: model:ir.model,name:document_page_multi_company.model_document_page
+msgid "Document Page"
+msgstr ""
+
+#. module: document_page_multi_company
+#: model:ir.model,name:document_page_multi_company.model_document_page_history
+msgid "Document Page History"
+msgstr ""
+

=== added directory 'document_page_multi_company/security'
=== added file 'document_page_multi_company/security/document_page_security.xml'
--- document_page_multi_company/security/document_page_security.xml	1970-01-01 00:00:00 +0000
+++ document_page_multi_company/security/document_page_security.xml	2013-08-28 14:37:46 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="1">
+
+    <record model="ir.rule" id="document_page_rule">
+        <field name="name">document_page multi-company</field>
+        <field name="model_id" ref="model_document_page"/>
+        <field name="global" eval="True"/>
+        <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+    </record>
+
+    <record model="ir.rule" id="document_page_history_rule">
+        <field name="name">document_page_history multi-company</field>
+        <field name="model_id" ref="model_document_page_history"/>
+        <field name="global" eval="True"/>
+        <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+    </record>
+
+    </data>
+</openerp>


Follow ups