Purpose: Having the res_group defined in base and sales_team auto installed with mail doens't make sense. - Move the empty res_config class and the related view from base_setup to sales_team (base_setup only contains the 'General Settings' model and views - Move the 'sale' related content from product to sale module (Access rights, menuitems,...) - Set sales_team at autoinstall False. The module is installed when needed by crm or sale for example - Set sales_team as a dependency of voip. (Access rights defined for configuration purpose) - Set sales_team ad a dependency of subscription (Access rights issue too) [FIX] account: move some ir.model.access to sale module [FIX] payment: Move some ir.rule to website_sale [FIX] stock: move some ir.model.access rule to sale_stock [FIX] project: Move some ir.model.access rules to crm_project_issue [FIX] mrp: Move some ir.model.access rules to sale_mrp [FIX] calendar: move some ir.model.access rules to crm Rename xmlids accordingly. Example: 'base.group_sale_manager' becomes sales_team.group_sale_manager. [ADD] sales_team: See own documents => See only his sales team Moved the "User: Own Leads Only", "User: All Leads" and "Manager" groups from sale and crm into sales_team module. Add the record rules so that user can see only his Own Sales Team if "See Own Leads" is sales right and can see all sales teams if he is having sales rights of "See All Leads" or manager.
58 lines
2.9 KiB
Python
58 lines
2.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo import api, fields, models
|
|
|
|
|
|
class BaseConfigSettings(models.TransientModel):
|
|
|
|
_name = 'base.config.settings'
|
|
_inherit = 'res.config.settings'
|
|
|
|
group_multi_company = fields.Boolean(string='Manage multiple companies',
|
|
help='Work in multi-company environments, with appropriate security access between companies.',
|
|
implied_group='base.group_multi_company')
|
|
module_share = fields.Boolean(string='Allow documents sharing',
|
|
help="""Share or embbed any screen of Odoo.""")
|
|
module_portal = fields.Boolean(string='Activate the customer portal',
|
|
help="""Give your customers access to their documents.""")
|
|
module_auth_oauth = fields.Boolean(string='Use external authentication providers (OAuth)')
|
|
module_base_import = fields.Boolean(string="Allow users to import data from CSV/XLS/XLSX/ODS files")
|
|
module_google_drive = fields.Boolean(string='Attach Google documents to any record',
|
|
help="""This installs the module google_docs.""")
|
|
module_google_calendar = fields.Boolean(
|
|
string='Allow the users to synchronize their calendar with Google Calendar',
|
|
help="""This installs the module google_calendar.""")
|
|
module_inter_company_rules = fields.Boolean(string='Manage Inter Company',
|
|
help="""This installs the module inter_company_rules.\n Configure company rules to automatically create SO/PO when one of your company sells/buys to another of your company.""")
|
|
company_share_partner = fields.Boolean(string='Share partners to all companies',
|
|
help="Share your partners to all companies defined in your instance.\n"
|
|
" * Checked : Partners are visible for every companies, even if a company is defined on the partner.\n"
|
|
" * Unchecked : Each company can see only its partner (partners where company is defined). Partners not related to a company are visible for all companies.")
|
|
group_multi_currency = fields.Boolean(string='Allow multi currencies',
|
|
implied_group='base.group_multi_currency',
|
|
help="Allows to work in a multi currency environment")
|
|
|
|
@api.multi
|
|
def open_company(self):
|
|
return {
|
|
'type': 'ir.actions.act_window',
|
|
'name': 'My Company',
|
|
'view_type': 'form',
|
|
'view_mode': 'form',
|
|
'res_model': 'res.company',
|
|
'res_id': self.env.user.company_id.id,
|
|
'target': 'current',
|
|
}
|
|
|
|
@api.model
|
|
def get_default_company_share_partner(self, fields):
|
|
return {
|
|
'company_share_partner': not self.env.ref('base.res_partner_rule').active
|
|
}
|
|
|
|
@api.multi
|
|
def set_default_company_share_partner(self):
|
|
partner_rule = self.env.ref('base.res_partner_rule')
|
|
for config in self:
|
|
partner_rule.write({'active': not config.company_share_partner})
|