-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '9.0' into page_planning
- Loading branch information
Showing
223 changed files
with
58,002 additions
and
1,220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
x | ||
|
||
Modules modifiés ou dévelopés par La Chouette Coop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Restrict access to Manage Databases feature, | ||
only administrator or members of 'Access Right' group allowed. | ||
|
||
Code modified by La Chouette Coop from original: | ||
https://github.com/OpenSur/Odoo_addons/tree/master/restrict_db_mgr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Product - Average Consumption Module for Odoo | ||
# Copyright (C) 2013-Today GRAP (http://www.grap.coop) | ||
# @author Julien WESTE | ||
# @author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# OpenERP, Open Source Enterprise Management Solution | ||
# risk_management Module | ||
# Copyright (C) 2014 OpenSur ([email protected]) | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
|
@@ -20,5 +19,4 @@ | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from . import model | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Purchase - Computed Purchase Order Module for Odoo | ||
# Copyright (C) 2013-Today GRAP (http://www.grap.coop) | ||
# @author Julien WESTE | ||
# @author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# OpenERP, Open Source Enterprise Management Solution | ||
# risk_management Module | ||
# Copyright (C) 2014 OpenSur ([email protected]) | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
|
@@ -20,10 +19,20 @@ | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
{ | ||
'name' : 'Restrict access to Manage Databases', | ||
'summary' : "Restrict access to Manage Databases feature, only administrator or members of 'Access Right' group allowed.", | ||
'category' : 'Website', | ||
'author' : 'OpenSur SA', | ||
'website' : 'http://www.opensur.com', | ||
'version' : '9.0.0.1.0', | ||
'license' : "AGPL-3", | ||
'depends': [ | ||
'base', | ||
'web', | ||
], | ||
'installable': True, | ||
'auto_install': True, | ||
'active': False, | ||
} | ||
|
||
from openerp import models | ||
|
||
|
||
class ComputedPurchaseOrderLine(models.Model): | ||
_inherit = 'computed.purchase.order.line' | ||
_order = 'product_code' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
chouettecoop_addons/restrict_db_mgr/controllers/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# Copyright (C) 2014 OpenSur. | ||
# | ||
# 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 import http | ||
from openerp import SUPERUSER_ID | ||
from openerp.http import request | ||
from openerp.addons.web.controllers.main import Database | ||
from openerp.exceptions import AccessError | ||
import werkzeug.utils | ||
|
||
ADMIN_CATEGORY = 'Administration' | ||
ADMIN_GROUP = 'Access Rights' | ||
|
||
class Database_restrict(Database): | ||
|
||
def _is_usr_admin(self): | ||
uid = request.session.uid | ||
if uid == SUPERUSER_ID: | ||
return True | ||
cr, context, registry = request.cr, request.context, request.registry | ||
admin_category = registry('ir.module.category').search( | ||
cr, SUPERUSER_ID, [('name','=',ADMIN_CATEGORY),]) | ||
if len(admin_category): | ||
admin_group = registry('res.groups').search(cr, SUPERUSER_ID, | ||
['&', ('name','=',ADMIN_GROUP), | ||
('category_id','=',admin_category[0]),]) | ||
if len(admin_group): | ||
user_id = registry('res.groups').search( | ||
cr, SUPERUSER_ID, | ||
[('id','=',admin_group[0]), ('users','in', [uid])], | ||
context=context) | ||
return user_id and True or False | ||
return False | ||
|
||
def _access_forbidden(self): | ||
return werkzeug.utils.redirect('/web/login', 303) | ||
|
||
@http.route('/web/database/manager') | ||
def manager(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).manager(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/create') | ||
def create(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).create(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/duplicate') | ||
def duplicate(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).duplicate(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/drop') | ||
def drop(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).drop(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/backup') | ||
def backup(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).backup(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/restore') | ||
def restore(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).restore(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
@http.route('/web/database/change_password') | ||
def change_password(self, *args, **kwargs): | ||
if self._is_usr_admin(): | ||
return super(Database_restrict, self).change_password(*args, **kwargs) | ||
else: | ||
return self._access_forbidden() | ||
|
||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
User Menu for La Chouette Coop, Odoo addon | ||
========================================== | ||
|
||
Replace the standard top right UserMenu: | ||
|
||
* Replace "Support" link from Odoo.com/buy to a link configurable in | ||
Configuration/General Settings/Menu Support | ||
* Remove "My Oddo Account" link | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# POS Payment Terminal module for Odoo | ||
# Copyright (C) 2015 Mathieu VATEL <[email protected]> | ||
# Require User Login, Odoo addon | ||
# Copyright La Chouette Coop | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
|
@@ -18,13 +18,25 @@ | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from openerp import models, fields | ||
|
||
|
||
class AccountJournal(models.Model): | ||
_inherit = 'account.journal' | ||
|
||
iface_automatic_cashdrawer = fields.Boolean( | ||
'Automatic cashdrawer', | ||
help="Check this if this journal is linked to an automatic cashdrawer") | ||
{ | ||
'name' : "User Menu for La Chouette Coop", | ||
'summary' : "Replace top right UserMenu: change support link, remvoe My Odoo Account link", | ||
'category' : 'Extra Tools', | ||
'author' : "La Chouette Coop", | ||
'website' : "http://www.lachouettecoop.fr", | ||
'license' : "AGPL-3", | ||
'version' : '9.0.0.0.1', | ||
'installable': True, | ||
'depends' : [ | ||
'base_setup', | ||
'base', | ||
'web', | ||
], | ||
'data' : [ | ||
'data/user_menu_chouette.xml', | ||
'views/res_config_view.xml', | ||
], | ||
'qweb' : [ | ||
'static/src/xml/base.xml', | ||
], | ||
} |
13 changes: 13 additions & 0 deletions
13
chouettecoop_addons/user_menu_chouette/data/user_menu_chouette.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
|
||
<!-- extend template addons/web/views/webclient_templates.xml to include our javascript file --> | ||
<template id="assets_backend" name="user_menu_chouette assets" inherit_id="web.assets_backend"> | ||
<xpath expr="." position="inside"> | ||
<script type="text/javascript" src="/user_menu_chouette/static/src/js/menu.js"></script> | ||
</xpath> | ||
</template> | ||
|
||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
from . import res_config |
40 changes: 40 additions & 0 deletions
40
chouettecoop_addons/user_menu_chouette/models/res_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Require User Login, Odoo addon | ||
# Copyright La Chouette Coop | ||
# | ||
# 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 import api, fields, models | ||
|
||
class user_menu_chouette_config_settings(models.TransientModel): | ||
""" Inherit the base setting to add the url to use for User Menu «Support» link. """ | ||
|
||
_inherit = 'base.config.settings' | ||
|
||
x_user_menu_support_url = fields.Char("Menu Support", help="Lien «Support» dans le menu utilisateur") | ||
|
||
@api.multi | ||
def get_default_x_user_menu_support_url(self): | ||
url = self.env["ir.config_parameter"].get_param("x_user_menu_support_url", default=None) | ||
return { 'x_user_menu_support_url': url or False } | ||
|
||
@api.multi | ||
def set_x_user_menu_support_url(self): | ||
for record in self: | ||
self.env['ir.config_parameter'].set_param("x_user_menu_support_url", self.x_user_menu_support_url or '') | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
chouettecoop_addons/user_menu_chouette/static/src/js/menu.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
odoo.define('user_menu_chouette.support_chouette', function (require) { | ||
"use strict"; | ||
|
||
var Model = require('web.Model'); | ||
var UserMenu = require('web.UserMenu'); | ||
|
||
// Modify behaviour of addons/web/static/src/js/widgets/user_menu.js | ||
UserMenu.include({ | ||
on_menu_support_chouette: function () { | ||
var support_window = window.open('', '_blank'); | ||
new Model('ir.config_parameter') | ||
.call('get_param', ['x_user_menu_support_url']) | ||
.then(function(url) { | ||
if (url) { | ||
support_window.location = url; | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
}); |
16 changes: 16 additions & 0 deletions
16
chouettecoop_addons/user_menu_chouette/static/src/xml/base.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates id="template" xml:space="preserve"> | ||
|
||
<!-- replace UserMenu dropdown-menu defined in addons/web/static/src/xml/base.xml --> | ||
<t t-extend="UserMenu" > | ||
<t t-jquery="ul.dropdown-menu" t-operation="inner"> | ||
<li><a href="#" data-menu="documentation">Documentation</a></li> | ||
<li><a href="#" data-menu="support_chouette">Support</a></li> | ||
<li><a href="#" data-menu="about">About</a></li> | ||
<li class="divider"/> | ||
<li><a href="#" data-menu="settings">Preferences</a></li> | ||
<li class="dropdown-menu-last"><a href="#" data-menu="logout">Log out</a></li> | ||
</t> | ||
</t> | ||
|
||
</templates> |
23 changes: 23 additions & 0 deletions
23
chouettecoop_addons/user_menu_chouette/views/res_config_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<!-- modify Configuration/GeneralSettings view defined in | ||
addons/base_setup/res_config_view.xml --> | ||
<record id="view_general_configuration_x_user_menu_support_url" model="ir.ui.view"> | ||
<field name="name">base.config.settings.x_user_menu_support_url</field> | ||
<field name="model">base.config.settings</field> | ||
<field name="inherit_id" ref="base_setup.view_general_configuration"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[@name='google']" position='before'> | ||
<group> | ||
<label for="x_user_menu_support_url"/> | ||
<div name="x_user_menu_support"> | ||
<field name="x_user_menu_support_url"/> | ||
<label string="Lien «Support» dans le menu utilisateur"/> | ||
</div> | ||
</group> | ||
</xpath> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |
Oops, something went wrong.