summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2016-08-11 11:27:27 +0530
committerYannick Tivisse <yti@odoo.com>2016-09-02 13:44:15 +0200
commit665781d5a8524e73ce2649665d1113d9e6c854d6 (patch)
tree9df1a7bc81578f0eaefb6a8e4e659b3561a7057a /addons
parentfb0cb419127d8fb869a43bded26fd5c2e348e158 (diff)
[IMP] various: Move all configuration fields from res_company form to the related modules
======= Purpose ======= The company form should be heavily simplified. It's complex to have some settings on the company form, and others on the Settings menu of the related app. It would be much easier to have all settings in Settings menu (res.config) and nothing on the company, even if some of the Settings are multi company. (Stored on the company but set from the Settings menu).
Diffstat (limited to 'addons')
-rw-r--r--addons/account/__openerp__.py1
-rw-r--r--addons/account/models/res_config.py11
-rw-r--r--addons/account/views/company_view.xml26
-rw-r--r--addons/account/views/res_config_view.xml15
-rw-r--r--addons/auth_ldap/__openerp__.py4
-rw-r--r--addons/auth_ldap/models/__init__.py1
-rw-r--r--addons/auth_ldap/models/auth_ldap_config_settings.py10
-rw-r--r--addons/auth_ldap/views/auth_ldap_config_settings_views.xml42
-rw-r--r--addons/auth_ldap/views/res_company_views.xml37
-rw-r--r--addons/base_setup/models/res_config.py16
-rw-r--r--addons/base_setup/views/res_config_views.xml42
-rw-r--r--addons/hr_timesheet_attendance/__openerp__.py1
-rw-r--r--addons/hr_timesheet_attendance/models/__init__.py1
-rw-r--r--addons/hr_timesheet_attendance/models/project_config_settings.py9
-rw-r--r--addons/hr_timesheet_attendance/views/hr_timesheet_attendance_config_settings_views.xml18
-rw-r--r--addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml18
-rw-r--r--addons/hr_timesheet_sheet/models/hr_timesheet_sheet_config_settings.py1
-rw-r--r--addons/hr_timesheet_sheet/models/res_company.py4
-rw-r--r--addons/hr_timesheet_sheet/views/hr_timesheet_sheet_config_settings_views.xml1
-rw-r--r--addons/hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml25
-rw-r--r--addons/l10n_fr_hr_payroll/__openerp__.py1
-rw-r--r--addons/l10n_fr_hr_payroll/models/__init__.py1
-rw-r--r--addons/l10n_fr_hr_payroll/models/l10n_fr_hr_payroll_config_settings.py14
-rw-r--r--addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_config_settings_views.xml34
-rw-r--r--addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_view.xml21
-rw-r--r--addons/mrp/__openerp__.py1
-rw-r--r--addons/mrp/models/mrp_config_settings.py3
-rw-r--r--addons/mrp/views/mrp_config_settings_views.xml4
-rw-r--r--addons/mrp/views/res_company_views.xml17
-rw-r--r--addons/pad/__openerp__.py4
-rw-r--r--addons/pad/models/__init__.py1
-rw-r--r--addons/pad/models/res_config.py11
-rw-r--r--addons/pad/views/res_company.xml16
-rw-r--r--addons/pad/views/res_config_view.xml22
-rw-r--r--addons/procurement/__openerp__.py1
-rw-r--r--addons/procurement/views/res_company_views.xml20
-rw-r--r--addons/project/models/res_config.py3
-rw-r--r--addons/project/views/project_views.xml14
-rw-r--r--addons/project/views/res_config_views.xml8
-rw-r--r--addons/purchase/__openerp__.py1
-rw-r--r--addons/purchase/models/res_config.py8
-rw-r--r--addons/purchase/views/res_company_views.xml19
-rw-r--r--addons/purchase/views/res_config_views.xml13
-rw-r--r--addons/report/__openerp__.py4
-rw-r--r--addons/report/models/__init__.py1
-rw-r--r--addons/report/models/base_config_settings.py19
-rw-r--r--addons/report/views/base_config_settings_views.xml23
-rw-r--r--addons/report/views/res_company_views.xml25
-rw-r--r--addons/sale/models/sale_config_settings.py3
-rw-r--r--addons/sale/views/sale_config_settings_views.xml9
-rw-r--r--addons/sale/views/sale_views.xml14
-rw-r--r--addons/sale_stock/__openerp__.py1
-rw-r--r--addons/sale_stock/models/sale_config_settings.py1
-rw-r--r--addons/sale_stock/views/res_company_views.xml16
-rw-r--r--addons/sale_stock/views/sale_config_settings_views.xml3
-rw-r--r--addons/sales_team/views/res_config_view.xml2
56 files changed, 350 insertions, 291 deletions
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 477655ac2b6..f3699bff585 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -38,7 +38,6 @@ You could use this simplified accounting in case you work with an (external) acc
'views/partner_view.xml',
'views/product_view.xml',
'views/account_analytic_view.xml',
- 'views/company_view.xml',
'views/res_config_view.xml',
'views/account_tip_data.xml',
'views/account.xml',
diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py
index 76de3db1d25..be03ef03a0f 100644
--- a/addons/account/models/res_config.py
+++ b/addons/account/models/res_config.py
@@ -40,13 +40,13 @@ class AccountConfigSettings(models.TransientModel):
has_chart_of_accounts = fields.Boolean(string='Company has a chart of accounts')
chart_template_id = fields.Many2one('account.chart.template', string='Template',
domain="[('visible','=', True)]")
- use_anglo_saxon = fields.Boolean(string='Use Anglo-Saxon Accounting', related='company_id.anglo_saxon_accounting')
- code_digits = fields.Integer(string='# of Digits', related='company_id.accounts_code_digits', help="No. of digits to use for account code")
+ use_anglo_saxon = fields.Boolean(string='Use Anglo-Saxon Accounting *', related='company_id.anglo_saxon_accounting')
+ code_digits = fields.Integer(string='# of Digits *', related='company_id.accounts_code_digits', help="No. of digits to use for account code")
tax_calculation_rounding_method = fields.Selection(
[
('round_per_line', 'Round calculation of taxes per line'),
('round_globally', 'Round globally calculation of taxes '),
- ], related='company_id.tax_calculation_rounding_method', string='Tax calculation rounding method',
+ ], related='company_id.tax_calculation_rounding_method', string='Tax calculation rounding method *',
help="""If you select 'Round per line' : for each tax, the tax amount will first be
computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed,
leading to the total amount for that tax. If you select 'Round globally': for each tax,
@@ -58,8 +58,8 @@ class AccountConfigSettings(models.TransientModel):
purchase_tax_id = fields.Many2one('account.tax.template', string='Default purchase tax', oldname="purchase_tax")
sale_tax_rate = fields.Float(string='Sales tax (%)')
purchase_tax_rate = fields.Float(string='Purchase tax (%)')
- bank_account_code_prefix = fields.Char(string='Bank Accounts Prefix', related='company_id.bank_account_code_prefix', help='Define the code prefix for the bank accounts', oldname='bank_account_code_char')
- cash_account_code_prefix = fields.Char(string='Cash Accounts Prefix', related='company_id.cash_account_code_prefix', help='Define the code prefix for the cash accounts')
+ bank_account_code_prefix = fields.Char(string='Bank Accounts Prefix *', related='company_id.bank_account_code_prefix', help='Define the code prefix for the bank accounts', oldname='bank_account_code_char')
+ cash_account_code_prefix = fields.Char(string='Cash Accounts Prefix *', related='company_id.cash_account_code_prefix', help='Define the code prefix for the cash accounts')
template_transfer_account_id = fields.Many2one('account.account.template', help="Intermediary account used when moving money from a liquidity account to another")
transfer_account_id = fields.Many2one('account.account',
related='company_id.transfer_account_id',
@@ -143,6 +143,7 @@ class AccountConfigSettings(models.TransientModel):
module_account_bank_statement_import_csv = fields.Boolean("Import in .csv format",
help='Get your bank statements from your bank and import them in Odoo in the .CSV format.\n'
'-This installs the module account_bank_statement_import_csv.')
+ overdue_msg = fields.Text(related='company_id.overdue_msg', string='Overdue Payments Message *')
@api.model
diff --git a/addons/account/views/company_view.xml b/addons/account/views/company_view.xml
deleted file mode 100644
index a3bd3fac5fc..00000000000
--- a/addons/account/views/company_view.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
- <data>
- <record model="ir.ui.view" id="view_company_inherit_form">
- <field name="name">res.company.form.inherit</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="model">res.company</field>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="inside">
- <field name="anglo_saxon_accounting"/>
- <field name="bank_account_code_prefix" groups="base.group_no_one"/>
- <field name="cash_account_code_prefix" groups="base.group_no_one"/>
- <field name="accounts_code_digits" groups="base.group_no_one"/>
- <field name="tax_calculation_rounding_method" groups="base.group_no_one"/>
- </xpath>
- <notebook position="inside">
- <page string="Overdue Payments">
- <separator string="Overdue Payments Message" colspan="4"/>
- <field name="overdue_msg" nolabel="1" colspan ="4"/>
- </page>
- </notebook>
- </field>
- </record>
-
- </data>
-</odoo>
diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml
index ba595c74aa8..5840947cf1f 100644
--- a/addons/account/views/res_config_view.xml
+++ b/addons/account/views/res_config_view.xml
@@ -98,7 +98,7 @@
</div>
</div>
</group>
- <group string="Accounting &amp; Finance">
+ <group string="Accounting &amp; Finance" name="accounting">
<label for="id" string="Options"/>
<div name="account_config">
<div>
@@ -258,6 +258,19 @@
<group name="analytic_account_purchase" invisible="1">
<label for="id" string="Purchase"/>
</group>
+ <group name="followup" position="before">
+ <field name="use_anglo_saxon"/>
+ <field name="bank_account_code_prefix" groups="base.group_no_one"/>
+ <field name="cash_account_code_prefix" groups="base.group_no_one"/>
+ <field name="code_digits" groups="base.group_no_one"/>
+ <field name="tax_calculation_rounding_method" groups="base.group_no_one"/>
+ </group>
+ <group string="Overdue Payments" name="followup">
+ <field name="overdue_msg"/>
+ </group>
+ <div>
+ <span>(*) This configuration value is related to the company you're logged in.</span>
+ </div>
</form>
</field>
</record>
diff --git a/addons/auth_ldap/__openerp__.py b/addons/auth_ldap/__openerp__.py
index 494521fb7dc..39f37e79573 100644
--- a/addons/auth_ldap/__openerp__.py
+++ b/addons/auth_ldap/__openerp__.py
@@ -2,13 +2,13 @@
{
'name' : 'Authentication via LDAP',
- 'depends' : ['base'],
+ 'depends' : ['base', 'base_setup'],
#'description': < auto-loaded from README file
'category' : 'Extra Tools',
'data' : [
- 'views/res_company_views.xml',
'views/ldap_installer_views.xml',
'security/ir.model.access.csv',
+ 'views/auth_ldap_config_settings_views.xml',
],
'external_dependencies' : {
'python' : ['ldap'],
diff --git a/addons/auth_ldap/models/__init__.py b/addons/auth_ldap/models/__init__.py
index ddc234b54b1..5ee6a1b93fb 100644
--- a/addons/auth_ldap/models/__init__.py
+++ b/addons/auth_ldap/models/__init__.py
@@ -3,3 +3,4 @@
import res_company
import res_company_ldap
import res_users
+import auth_ldap_config_settings \ No newline at end of file
diff --git a/addons/auth_ldap/models/auth_ldap_config_settings.py b/addons/auth_ldap/models/auth_ldap_config_settings.py
new file mode 100644
index 00000000000..2d29bca1f08
--- /dev/null
+++ b/addons/auth_ldap/models/auth_ldap_config_settings.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class BaseConfigSettings(models.TransientModel):
+ _inherit = 'base.config.settings'
+
+ ldaps = fields.One2many(related='company_id.ldaps', string="LDAP Parameters *")
diff --git a/addons/auth_ldap/views/auth_ldap_config_settings_views.xml b/addons/auth_ldap/views/auth_ldap_config_settings_views.xml
new file mode 100644
index 00000000000..b4586c8945d
--- /dev/null
+++ b/addons/auth_ldap/views/auth_ldap_config_settings_views.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="view_general_configuration_form_inherit_auth_ldap" model="ir.ui.view">
+ <field name="name">base.config.settings.form.inherit.auth.ldap</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_analytics']" position="after">
+ <group string="LDAP Parameters">
+ <label for="ldaps"/>
+ <div class="row">
+ <div class="col-xs-6">
+ <field name="ldaps">
+ <form string="LDAP Configuration">
+ <group col="4">
+ <field name="ldap_server"/>
+ <field name="ldap_server_port"/>
+ <field name="ldap_binddn"/>
+ <field name="ldap_password" password="True"/>
+ <field name="ldap_base"/>
+ <field name="ldap_filter"/>
+ <field name="create_user"/>
+ <field name="user"/>
+ <newline/>
+ <field name="sequence"/>
+ <field name="ldap_tls"/>
+ </group>
+ </form>
+ <tree string="LDAP Configuration">
+ <field name="sequence"/>
+ <field name="ldap_server"/>
+ <field name="ldap_server_port"/>
+ <field name="ldap_base"/>
+ </tree>
+ </field>
+ </div>
+ </div>
+ </group>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/auth_ldap/views/res_company_views.xml b/addons/auth_ldap/views/res_company_views.xml
deleted file mode 100644
index e3668c4e0a4..00000000000
--- a/addons/auth_ldap/views/res_company_views.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
- <record id="company_form_view" model="ir.ui.view">
- <field name="name">res.company.form.inherit</field>
- <field name="model">res.company</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group string="LDAP Parameters">
- <field name="ldaps" nolabel="1" colspan="4">
- <form string="LDAP Configuration">
- <group col="4">
- <field name="ldap_server"/>
- <field name="ldap_server_port"/>
- <field name="ldap_binddn"/>
- <field name="ldap_password" password="True"/>
- <field name="ldap_base"/>
- <field name="ldap_filter"/>
- <field name="create_user"/>
- <field name="user"/>
- <newline/>
- <field name="sequence"/>
- <field name="ldap_tls"/>
- </group>
- </form>
- <tree string="LDAP Configuration">
- <field name="sequence"/>
- <field name="ldap_server"/>
- <field name="ldap_server_port"/>
- <field name="ldap_base"/>
- </tree>
- </field>
- </group>
- </xpath>
- </field>
- </record>
-</odoo>
diff --git a/addons/base_setup/models/res_config.py b/addons/base_setup/models/res_config.py
index d30a2771a5d..8b1d9a5e828 100644
--- a/addons/base_setup/models/res_config.py
+++ b/addons/base_setup/models/res_config.py
@@ -11,6 +11,8 @@ class BaseConfigSettings(models.TransientModel):
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')
+ company_id = fields.Many2one('res.company', string='Company', required=True,
+ default=lambda self: self.env.user.company_id)
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',
@@ -32,6 +34,17 @@ class BaseConfigSettings(models.TransientModel):
implied_group='base.group_multi_currency',
help="Allows to work in a multi currency environment")
+ # Report config from base/res/res_company.py
+ custom_footer = fields.Boolean(related="company_id.custom_footer", string="Custom footer *", help="Check this to define the report footer manually. Otherwise it will be filled in automatically.")
+ rml_footer = fields.Text(related="company_id.rml_footer", string='Custom Report Footer *', help="Footer text displayed at the bottom of all reports.")
+ rml_footer_readonly = fields.Text(related='rml_footer', string='Report Footer *', readonly=True)
+ rml_paper_format = fields.Selection(related="company_id.rml_paper_format", string="Paper Format *", required=True)
+ font = fields.Many2one(related='company_id.font', string="Font *", help="Set the font into the report header, it will be used as default font in the RML reports of the user company")
+ rml_header = fields.Text(related="company_id.rml_header", string="RML Header *")
+ rml_header2 = fields.Text(related="company_id.rml_header2", string='RML Internal Header *')
+ rml_header3 = fields.Text(related="company_id.rml_header3", string='RML Internal Header for Landscape Reports *')
+
+
@api.multi
def open_company(self):
return {
@@ -63,3 +76,6 @@ class BaseConfigSettings(models.TransientModel):
partner_rule = self.env.ref('base.res_partner_rule')
for config in self:
partner_rule.write({'active': not config.company_share_partner})
+
+ def act_discover_fonts(self):
+ self.company_id.act_discover_fonts()
diff --git a/addons/base_setup/views/res_config_views.xml b/addons/base_setup/views/res_config_views.xml
index 1996530b637..10c55e76b90 100644
--- a/addons/base_setup/views/res_config_views.xml
+++ b/addons/base_setup/views/res_config_views.xml
@@ -13,6 +13,7 @@
<div>
<label string="You will find more options in your company details: address for the header and footer, overdue payments texts, etc."/>
<button type="object" name="open_company" string="Configure your company data" icon="fa-cogs" class="oe_inline oe_link"/>
+ <field name="company_id" invisible="1"/>
</div>
<group>
<label for="id" string="Email" name="email_label"/>
@@ -109,6 +110,47 @@
</div>
</div>
</group>
+ <group string="Report Configuration" name="report">
+ <label for="custom_footer"/>
+ <div>
+ <field name="custom_footer" class="oe_inline"/>
+ </div>
+ <label for="rml_footer"/>
+ <div>
+ <field name="rml_footer" class="oe_inline"/>
+ </div>
+ <label for="rml_footer_readonly"/>
+ <div>
+ <field name="rml_footer_readonly" class="oe_inline"/>
+ </div>
+ </group>
+ <group string="RML Report Configuration" groups="base.group_no_one">
+ <button name="%(base.preview_rml_report)d" string="Preview RML Report" type="action" colspan="2"/>
+ <label for="rml_paper_format"/>
+ <div>
+ <field name="rml_paper_format" class="oe_inline"/>
+ </div>
+ <label for="font"/>
+ <div>
+ <field name="font" class="oe_inline"/>
+ <button string="(reload fonts)" name="act_discover_fonts" type="object" class="oe_link"/>
+ </div>
+ <label for="rml_header"/>
+ <div>
+ <field name="rml_header"/>
+ </div>
+ <label for="rml_header2"/>
+ <div>
+ <field name="rml_header2"/>
+ </div>
+ <label for="rml_header3"/>
+ <div>
+ <field name="rml_header3"/>
+ </div>
+ </group>
+ <div name="company_dependent_settings_message">
+ <span>(*) This configuration value is related to the company you're logged in.</span>
+ </div>
</form>
</field>
</record>
diff --git a/addons/hr_timesheet_attendance/__openerp__.py b/addons/hr_timesheet_attendance/__openerp__.py
index f3af1ac4711..a5d3e313464 100644
--- a/addons/hr_timesheet_attendance/__openerp__.py
+++ b/addons/hr_timesheet_attendance/__openerp__.py
@@ -12,6 +12,7 @@
'security/ir.model.access.csv',
'report/hr_timesheet_attendance_report_view.xml',
'views/hr_timesheet_sheet_views.xml',
+ 'views/hr_timesheet_attendance_config_settings_views.xml',
],
'auto_install': True,
}
diff --git a/addons/hr_timesheet_attendance/models/__init__.py b/addons/hr_timesheet_attendance/models/__init__.py
index e9110f22b7c..24e4387943f 100644
--- a/addons/hr_timesheet_attendance/models/__init__.py
+++ b/addons/hr_timesheet_attendance/models/__init__.py
@@ -4,3 +4,4 @@
import hr_attendance
import hr_timesheet_sheet
import res_company
+import project_config_settings \ No newline at end of file
diff --git a/addons/hr_timesheet_attendance/models/project_config_settings.py b/addons/hr_timesheet_attendance/models/project_config_settings.py
new file mode 100644
index 00000000000..d38f3520b50
--- /dev/null
+++ b/addons/hr_timesheet_attendance/models/project_config_settings.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+class HrTimesheetConfiguration(models.TransientModel):
+ _inherit = 'project.config.settings'
+
+ timesheet_max_difference = fields.Float(related='company_id.timesheet_max_difference', string="Timesheet allowed difference(Hours) *")
diff --git a/addons/hr_timesheet_attendance/views/hr_timesheet_attendance_config_settings_views.xml b/addons/hr_timesheet_attendance/views/hr_timesheet_attendance_config_settings_views.xml
new file mode 100644
index 00000000000..9a036597094
--- /dev/null
+++ b/addons/hr_timesheet_attendance/views/hr_timesheet_attendance_config_settings_views.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="view_config_settings_form_inherit_hr_timesheet_attendance" model="ir.ui.view">
+ <field name="name">project.config.settings.form.inherit.timesheet.attendance</field>
+ <field name="model">project.config.settings</field>
+ <field name="inherit_id" ref="hr_timesheet_sheet.view_config_settings_form_inherit_hr_timesheet_sheet"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@name='timesheets']/label[@for='id']" position="before">
+ <label for="timesheet_max_difference"/>
+ <div>
+ <field name="timesheet_max_difference" required="1" class="oe_inline"/>
+ </div>
+ </xpath>
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml b/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml
index 2417c238ed8..56cadf5e076 100644
--- a/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml
+++ b/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml
@@ -140,22 +140,4 @@
</field>
</record>
- <!--
- Company inheritancy
- -->
-
- <record id="hr_timesheet_sheet_company" model="ir.ui.view">
- <field name="name">res.company.sheet</field>
- <field name="model">res.company</field>
- <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_company"/>
- <field name="arch" type="xml">
- <div class="o_hr_timesheet_sheet_timesheet_range" position="after">
- <div>
- <label for="timesheet_max_difference"/>
- <field name="timesheet_max_difference" required="1" class="oe_inline"/>
- </div>
- </div>
- </field>
- </record>
-
</odoo>
diff --git a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet_config_settings.py b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet_config_settings.py
index f26fcfb2561..e48a18cdbe8 100644
--- a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet_config_settings.py
+++ b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet_config_settings.py
@@ -8,3 +8,4 @@ class HrTimesheetConfiguration(models.TransientModel):
_inherit = 'project.config.settings'
module_project_timesheet_synchro = fields.Boolean(string="Timesheet app for Chrome/Android/iOS")
+ timesheet_range = fields.Selection(related='company_id.timesheet_range', string="Timesheet range *")
diff --git a/addons/hr_timesheet_sheet/models/res_company.py b/addons/hr_timesheet_sheet/models/res_company.py
index 46267b9b8a2..b4a5ef24ac2 100644
--- a/addons/hr_timesheet_sheet/models/res_company.py
+++ b/addons/hr_timesheet_sheet/models/res_company.py
@@ -9,7 +9,3 @@ class ResCompany(models.Model):
timesheet_range = fields.Selection([('week', 'Week'), ('month', 'Month')],
default='week', string='Timesheet range', help="Periodicity on which you validate your timesheets.")
- timesheet_max_difference = fields.Float(string='Timesheet allowed difference(Hours)',
- help="Allowed difference in hours between the sign in/out and the timesheet " \
- "computation for one sheet. Set this to 0 if you do not want any control.",
- default=0.0)
diff --git a/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_config_settings_views.xml b/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_config_settings_views.xml
index 695ea0ae152..24e309070cf 100644
--- a/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_config_settings_views.xml
+++ b/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_config_settings_views.xml
@@ -10,6 +10,7 @@
<attribute name="string">Timesheets</attribute>
</xpath>
<xpath expr="//group[@name='timesheets']" position="inside">
+ <field name="timesheet_range" required="1" class="oe_inline"/>
<label for="id" string="Extra features"/>
<div>
<field name="module_project_timesheet_synchro" widget="upgrade_boolean"/>
diff --git a/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml b/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml
index c308e1ccaa5..8418b61a921 100644
--- a/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml
+++ b/addons/hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml
@@ -192,31 +192,6 @@
<menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="menu_hr_to_approve"
sequence="11" groups="base.group_hr_user"/>
-
- <!--
- Company inheritancy
- -->
-
- <record id="hr_timesheet_sheet_company" model="ir.ui.view">
- <field name="name">res.company.sheet</field>
- <field name="model">res.company</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group name="timesheets_grp" string="Timesheets">
- <div class="o_hr_timesheet_sheet_timesheet_range">
- <label for="timesheet_range"/>
- <field name="timesheet_range" required="1" class="oe_inline"/>
- </div>
- <!-- <div>
- <label for="timesheet_max_difference"/>
- <field name="timesheet_max_difference" required="1" class="oe_inline"/>
- </div> -->
- </group>
- </xpath>
- </field>
- </record>
-
<!--
account.analytic.line inheritancy
-->
diff --git a/addons/l10n_fr_hr_payroll/__openerp__.py b/addons/l10n_fr_hr_payroll/__openerp__.py
index 633d6f7e0c5..22845132713 100644
--- a/addons/l10n_fr_hr_payroll/__openerp__.py
+++ b/addons/l10n_fr_hr_payroll/__openerp__.py
@@ -30,5 +30,6 @@ TODO:
'views/l10n_fr_hr_payroll_view.xml',
'report/report_l10n_fr_fiche_paye.xml',
'report/l10n_fr_hr_payroll_report.xml',
+ 'views/l10n_fr_hr_payroll_config_settings_views.xml',
],
}
diff --git a/addons/l10n_fr_hr_payroll/models/__init__.py b/addons/l10n_fr_hr_payroll/models/__init__.py
index efba7da1eb6..caab8c46be8 100644
--- a/addons/l10n_fr_hr_payroll/models/__init__.py
+++ b/addons/l10n_fr_hr_payroll/models/__init__.py
@@ -2,3 +2,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import l10n_fr_hr_payroll
+import l10n_fr_hr_payroll_config_settings
diff --git a/addons/l10n_fr_hr_payroll/models/l10n_fr_hr_payroll_config_settings.py b/addons/l10n_fr_hr_payroll/models/l10n_fr_hr_payroll_config_settings.py
new file mode 100644
index 00000000000..9aa25a34406
--- /dev/null
+++ b/addons/l10n_fr_hr_payroll/models/l10n_fr_hr_payroll_config_settings.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class AccountConfigSettings(models.TransientModel):
+ _inherit = 'account.config.settings'
+
+ plafond_secu = fields.Float(related='company_id.plafond_secu', string="Plafond de la Securite Sociale *")
+ nombre_employes = fields.Integer(related='company_id.nombre_employes', string="Nombre d'employes *")
+ cotisation_prevoyance = fields.Float(related='company_id.cotisation_prevoyance', string='Cotisation Patronale Prevoyance *')
+ org_ss = fields.Char(related='company_id.org_ss', string="Organisme de securite sociale *")
+ conv_coll = fields.Char(related='company_id.conv_coll', string="Convention collective *")
diff --git a/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_config_settings_views.xml b/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_config_settings_views.xml
new file mode 100644
index 00000000000..1be56bf28b0
--- /dev/null
+++ b/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_config_settings_views.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="view_account_config_settings_form_inherit_l10n_fr_hr_payroll" model="ir.ui.view">
+ <field name="name">view.account.config.form.inherit.l10n.fr.hr.payroll</field>
+ <field name="model">account.config.settings</field>
+ <field name="inherit_id" ref="account.view_account_config_settings"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@name='followup']" position="before">
+ <group string="Paie">
+ <label for="plafond_secu"/>
+ <div>
+ <field name="plafond_secu" class="oe_inline"/>
+ </div>
+ <label for="nombre_employes"/>
+ <div>
+ <field name="nombre_employes" class="oe_inline"/>
+ </div>
+ <label for="cotisation_prevoyance"/>
+ <div>
+ <field name="cotisation_prevoyance" class="oe_inline"/>
+ </div>
+ <label for="org_ss"/>
+ <div>
+ <field name="org_ss" class="oe_inline"/>
+ </div>
+ <label for="conv_coll"/>
+ <div>
+ <field name="conv_coll" class="oe_inline"/>
+ </div>
+ </group>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_view.xml b/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_view.xml
index f2b0b89447e..e97b918ab62 100644
--- a/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_view.xml
+++ b/addons/l10n_fr_hr_payroll/views/l10n_fr_hr_payroll_view.xml
@@ -1,26 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
- <record id="res_company_form_l10n_fr_payroll" model="ir.ui.view">
- <field name="name">res.company.form.l10n.fr.payroll</field>
- <field name="model">res.company</field>
- <field name="priority">20</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <data>
- <xpath expr="//group[@name='account_grp']" position="after">
- <group string="Paie">
- <field name="plafond_secu"/>
- <field name="nombre_employes"/>
- <newline/>
- <field name="org_ss"/>
- <newline/>
- <field name="conv_coll"/>
- </group>
- </xpath>
- </data>
- </field>
- </record>
-
<record id="hr_contract_view_form_l10n_fr_payroll" model="ir.ui.view">
<field name="name">hr.contract.view.form.l10n.fr.payroll</field>
<field name="model">hr.contract</field>
diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py
index 45d9248247e..e8b5aa798e6 100644
--- a/addons/mrp/__openerp__.py
+++ b/addons/mrp/__openerp__.py
@@ -56,7 +56,6 @@ Dashboard / Reports for MRP will include:
'views/stock_picking_views.xml',
'views/mrp_unbuild_views.xml',
'views/ir_attachment_view.xml',
- 'views/res_company_views.xml',
'views/mrp_config_settings_views.xml',
'views/mrp_templates.xml',
'views/stock_scrap_views.xml',
diff --git a/addons/mrp/models/mrp_config_settings.py b/addons/mrp/models/mrp_config_settings.py
index df7d4ac7583..02d609c7ea0 100644
--- a/addons/mrp/models/mrp_config_settings.py
+++ b/addons/mrp/models/mrp_config_settings.py
@@ -8,6 +8,9 @@ class MrpConfigSettings(models.TransientModel):
_name = 'mrp.config.settings'
_inherit = 'res.config.settings'
+ company_id = fields.Many2one('res.company', string='Company', required=True,
+ default=lambda self: self.env.user.company_id)
+ manufacturing_lead = fields.Float(related='company_id.manufacturing_lead', string="Manufacturing Lead Time *")
group_product_variant = fields.Selection([
(0, "No variants on products"),
(1, 'Products can have several attributes, defining variants (Example: size, color,...)')], "Product Variants",
diff --git a/addons/mrp/views/mrp_config_settings_views.xml b/addons/mrp/views/mrp_config_settings_views.xml
index 1d539909735..148a99cbd48 100644
--- a/addons/mrp/views/mrp_config_settings_views.xml
+++ b/addons/mrp/views/mrp_config_settings_views.xml
@@ -10,6 +10,10 @@
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
+ <group string="Logistics" name="logistics">
+ <field name="company_id" invisible="1"/>
+ <field name="manufacturing_lead"/>
+ </group>
<group string="Manufacturing Order">
<field name="group_product_variant" widget="radio"/>
<field name="module_mrp_byproduct" widget="radio"/>
diff --git a/addons/mrp/views/res_company_views.xml b/addons/mrp/views/res_company_views.xml
deleted file mode 100644
index fb83243ca86..00000000000
--- a/addons/mrp/views/res_company_views.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" ?>
-<odoo>
- <data>
- <record id="mrp_company" model="ir.ui.view">
- <field name="name">res.company.mrp.config</field>
- <field name="model">res.company</field>
- <field name="priority">22</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='logistics_grp']" position="inside">
- <field name="manufacturing_lead"/>
- </xpath>
- </field>
- </record>
-
- </data>
-</odoo>
diff --git a/addons/pad/__openerp__.py b/addons/pad/__openerp__.py
index ceb027bf592..3d68dcb2233 100644
--- a/addons/pad/__openerp__.py
+++ b/addons/pad/__openerp__.py
@@ -13,10 +13,10 @@ Lets the company customize which Pad installation should be used to link to new
pads (by default, http://etherpad.com/).
""",
'website': 'https://www.odoo.com/page/notes',
- 'depends': ['web'],
+ 'depends': ['web', 'base_setup'],
'data': [
'views/pad.xml',
- 'views/res_company.xml',
+ 'views/res_config_view.xml',
],
'demo': ['data/pad_demo.xml'],
'web': True,
diff --git a/addons/pad/models/__init__.py b/addons/pad/models/__init__.py
index 53c307d5e75..8782ea60140 100644
--- a/addons/pad/models/__init__.py
+++ b/addons/pad/models/__init__.py
@@ -3,3 +3,4 @@
import pad
import res_company
+import res_config
diff --git a/addons/pad/models/res_config.py b/addons/pad/models/res_config.py
new file mode 100644
index 00000000000..304ee926358
--- /dev/null
+++ b/addons/pad/models/res_config.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class BaseConfigSettings(models.TransientModel):
+ _inherit = 'base.config.settings'
+
+ pad_server = fields.Char(related='company_id.pad_server', string="Pad Server *")
+ pad_key = fields.Char(related='company_id.pad_key', string="Pad Api Key *")
diff --git a/addons/pad/views/res_company.xml b/addons/pad/views/res_company.xml
deleted file mode 100644
index 852aedd7593..00000000000
--- a/addons/pad/views/res_company.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
- <record id="view_company_form_inherit_pad" model="ir.ui.view">
- <field name="name">res.company.form.inherit</field>
- <field name="model">res.company</field>
- <field name="inherit_id" ref="base.view_company_form" />
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group string="Pads">
- <field name="pad_server" placeholder="e.g. beta.primarypad.com" />
- <field name="pad_key" />
- </group>
- </xpath>
- </field>
- </record>
-</odoo>
diff --git a/addons/pad/views/res_config_view.xml b/addons/pad/views/res_config_view.xml
new file mode 100644
index 00000000000..29056eeb282
--- /dev/null
+++ b/addons/pad/views/res_config_view.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="view_general_configuration_form_inherit_pad" model="ir.ui.view">
+ <field name="name">base.config.settings.form.inherit</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 string="Pads">
+ <label for="pad_server"/>
+ <div>
+ <field name="pad_server" placeholder="e.g. beta.primarypad.com" class="oe_inline"/>
+ </div>
+ <label for="pad_key"/>
+ <div>
+ <field name="pad_key" class="oe_inline"/>
+ </div>
+ </group>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/procurement/__openerp__.py b/addons/procurement/__openerp__.py
index 44e30dfda94..0c53385701b 100644
--- a/addons/procurement/__openerp__.py
+++ b/addons/procurement/__openerp__.py
@@ -34,7 +34,6 @@ Procurements in exception should be checked manually and can be re-run.
'data/procurement_data.xml',
'wizard/procurement_order_compute_all_views.xml',
'views/procurement_views.xml',
- 'views/res_company_views.xml',
'views/product_views.xml',
],
'demo': [],
diff --git a/addons/procurement/views/res_company_views.xml b/addons/procurement/views/res_company_views.xml
deleted file mode 100644
index c3c69eb8420..00000000000
--- a/addons/procurement/views/res_company_views.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" ?>
-<odoo>
- <data>
-
- <record id="mrp_company" model="ir.ui.view">
- <field name="name">res.company.mrp.config</field>
- <field name="model">res.company</field>
- <field name="priority">17</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group name="logistics_grp" string="Logistics">
- <!-- This group will be filled by other modules like sale_stock, mrp, purchase... -->
- </group>
- </xpath>
- </field>
- </record>
-
- </data>
-</odoo>
diff --git a/addons/project/models/res_config.py b/addons/project/models/res_config.py
index f7092a024da..a5588d87620 100644
--- a/addons/project/models/res_config.py
+++ b/addons/project/models/res_config.py
@@ -8,6 +8,9 @@ class ProjectConfiguration(models.TransientModel):
_name = 'project.config.settings'
_inherit = 'res.config.settings'
+ company_id = fields.Many2one('res.company', string='Company', required=True,
+ default=lambda self: self.env.user.company_id)
+ project_time_mode_id = fields.Many2one(related='company_id.project_time_mode_id', string="Project Time Unit *")
module_pad = fields.Selection([
(0, "Task description is a plain text"),
(1, "Collaborative rich text on task description")
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index aa3994902ee..dc8013c4e15 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -685,20 +685,6 @@ action = model.activate_sample_project()
<menuitem action="open_view_project_all" id="menu_projects" name="Dashboard" parent="base.menu_main_pm" sequence="1"/>
<menuitem action="open_view_project_all_config" id="menu_projects_config" name="Projects" parent="menu_project_config" sequence="10"/>
-
- <record id="task_company" model="ir.ui.view">
- <field name="name">res.company.task.config</field>
- <field name="model">res.company</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group name="project_grp" string="Projects">
- <field name="project_time_mode_id" domain="[('category_id','=', %(product.uom_categ_wtime)d)]" groups="base.group_no_one"/>
- </group>
- </xpath>
- </field>
- </record>
-
<!-- User Form -->
<act_window context="{'search_default_user_id': [active_id], 'default_user_id': active_id}"
id="act_res_users_2_project_task_opened" name="Assigned Tasks"
diff --git a/addons/project/views/res_config_views.xml b/addons/project/views/res_config_views.xml
index 73c8551e0ba..3a7abe453e1 100644
--- a/addons/project/views/res_config_views.xml
+++ b/addons/project/views/res_config_views.xml
@@ -11,6 +11,11 @@
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<group string="Project Management" name="project_management">
+ <field name="company_id" invisible="1"/>
+ <label for="project_time_mode_id" groups="base.group_no_one"/>
+ <div groups="base.group_no_one">
+ <field name="project_time_mode_id" domain="[('category_id','=', %(product.uom_categ_wtime)d)]" class="oe_inline"/>
+ </div>
<field name="module_pad" widget="radio"/>
<label for="id" string="Forecasts"/>
<div>
@@ -23,6 +28,9 @@
<field name="module_rating_project" widget="radio"/>
</group>
<group name="timesheets"/>
+ <div>
+ <span>(*) This configuration value is related to the company you're logged in.</span>
+ </div>
</form>
</field>
</record>
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index 5002fd853c2..3c3470196e3 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -30,7 +30,6 @@ Dashboard / Reports for Purchase Management will include:
'security/purchase_security.xml',
'security/ir.model.access.csv',
'views/account_invoice_views.xml',
- 'views/res_company_views.xml',
'data/purchase_data.xml',
'data/purchase_data.yml',
'report/purchase_reports.xml',
diff --git a/addons/purchase/models/res_config.py b/addons/purchase/models/res_config.py
index ce5244466d0..1a359e40b3b 100644
--- a/addons/purchase/models/res_config.py
+++ b/addons/purchase/models/res_config.py
@@ -8,6 +8,14 @@ class PurchaseConfigSettings(models.TransientModel):
_name = 'purchase.config.settings'
_inherit = 'res.config.settings'
+ company_id = fields.Many2one('res.company', string='Company', required=True,
+ default=lambda self: self.env.user.company_id)
+ po_lead = fields.Float(related='company_id.po_lead', string="Purchase Lead Time *")
+ po_lock = fields.Selection(related='company_id.po_lock', string="Purchase Order Modification *")
+ po_double_validation = fields.Selection(related='company_id.po_double_validation', string="Levels of Approvals *")
+ po_double_validation_amount = fields.Monetary(related='company_id.po_double_validation_amount', string="Double validation amount *", currency_field='company_currency_id')
+ company_currency_id = fields.Many2one('res.currency', related='company_id.currency_id', readonly=True,
+ help='Utility field to express amount currency')
group_product_variant = fields.Selection([
(0, "No variants on products"),
(1, 'Products can have several attributes, defining variants (Example: size, color,...)')
diff --git a/addons/purchase/views/res_company_views.xml b/addons/purchase/views/res_company_views.xml
deleted file mode 100644
index 2b94a56a32b..00000000000
--- a/addons/purchase/views/res_company_views.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
-
- <record id="mrp_company" model="ir.ui.view">
- <field name="name">res.company.mrp.config</field>
- <field name="model">res.company</field>
- <field name="priority">19</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='logistics_grp']" position="inside">
- <field name="po_lead"/>
- <field name="po_lock" widget="radio"/>
- <field name="po_double_validation" widget="radio"/>
- <field name="po_double_validation_amount" attrs="{'invisible': [('po_double_validation', '=', 'one_step')]}"/>
- </xpath>
- </field>
- </record>
-
-</odoo>
diff --git a/addons/purchase/views/res_config_views.xml b/addons/purchase/views/res_config_views.xml
index ecdf91bf0f9..83dffcef86b 100644
--- a/addons/purchase/views/res_config_views.xml
+++ b/addons/purchase/views/res_config_views.xml
@@ -9,6 +9,16 @@
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
+ <group string="Logistics">
+ <group>
+ <field name="company_id" invisible="1"/>
+ <field name="company_currency_id" invisible="1"/>
+ <field name="po_lead"/>
+ <field name="po_lock" widget="radio"/>
+ <field name="po_double_validation" widget="radio"/>
+ <field name="po_double_validation_amount" attrs="{'invisible': [('po_double_validation', '=', 'one_step')]}"/>
+ </group>
+ </group>
<group string="Purchase Order">
<field name="group_product_variant" widget="radio"/>
<field name="group_uom" widget="radio"/>
@@ -20,6 +30,9 @@
<group string="Location &amp; Warehouse">
<field name="module_stock_dropshipping" widget="radio"/>
</group>
+ <div>
+ <span>(*) This configuration value is related to the company you're logged in.</span>
+ </div>
</form>
</field>
</record>
diff --git a/addons/report/__openerp__.py b/addons/report/__openerp__.py
index 5ef4ba42d54..aa2f81daa26 100644
--- a/addons/report/__openerp__.py
+++ b/addons/report/__openerp__.py
@@ -8,14 +8,14 @@
'description': """
Report
""",
- 'depends': ['base', 'web'],
+ 'depends': ['base', 'web', 'base_setup'],
'data': [
'data/report_paperformat_data.xml',
'security/ir.model.access.csv',
'views/layout_templates.xml',
'views/report_paperformat_views.xml',
'views/report_templates.xml',
- 'views/res_company_views.xml',
+ 'views/base_config_settings_views.xml',
'views/ir_actions_report_views.xml',
],
'qweb' : [
diff --git a/addons/report/models/__init__.py b/addons/report/models/__init__.py
index cc85d6af6a2..93024339833 100644
--- a/addons/report/models/__init__.py
+++ b/addons/report/models/__init__.py
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import abstract_report
+import base_config_settings
import ir_actions_report_xml
import ir_http
import ir_qweb
diff --git a/addons/report/models/base_config_settings.py b/addons/report/models/base_config_settings.py
new file mode 100644
index 00000000000..16e2e0142f5
--- /dev/null
+++ b/addons/report/models/base_config_settings.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class BaseConfigSettings(models.TransientModel):
+ _inherit = 'base.config.settings'
+
+ paperformat_id = fields.Many2one(related="company_id.paperformat_id", string='Paper format *')
+
+ def edit_external_header(self):
+ return self.company_id.edit_external_header()
+
+ def edit_external_footer(self):
+ return self.company_id.edit_external_footer()
+
+ def edit_internal_header(self):
+ return self.company_id.edit_internal_header()
diff --git a/addons/report/views/base_config_settings_views.xml b/addons/report/views/base_config_settings_views.xml
new file mode 100644
index 00000000000..5e2766736f7
--- /dev/null
+++ b/addons/report/views/base_config_settings_views.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="base_config_settings_inherited" model="ir.ui.view">
+ <field name="name">base.config.settings.inherited</field>
+ <field name="inherit_id" ref="base_setup.view_general_configuration"/>
+ <field name="model">base.config.settings</field>
+ <field name="arch" type="xml">
+ <data>
+ <group name="report" position="inside">
+ <label for="paperformat_id"/>
+ <div>
+ <field name="paperformat_id" class="oe_inline"/>
+ <button name="%(action_report_internalpreview)d" string="Preview Internal Report" type="action"/>
+ <button name="%(action_report_externalpreview)d" string="Preview External Report" type="action"/>
+ <button name="edit_external_header" string="Edit external header" type="object" class="oe_link"/>
+ <button name="edit_external_footer" string="Edit external footer" type="object" class="oe_link"/>
+ <button name="edit_internal_header" string="Edit internal header" type="object" class="oe_link"/>
+ </div>
+ </group>
+ </data>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/report/views/res_company_views.xml b/addons/report/views/res_company_views.xml
deleted file mode 100644
index d5ecab58bd9..00000000000
--- a/addons/report/views/res_company_views.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
- <record id="reporting_settings_form_inherited" model="ir.ui.view">
- <field name="name">view_company_form_inherited</field>
- <field name="inherit_id" ref="base.view_company_form" />
- <field name="model">res.company</field>
- <field name="arch" type="xml">
- <data>
- <xpath expr="//page[@name='report']/group[1]" position="inside">
- <group col="2" colspan="2">
- <field name="paperformat_id" />
- </group>
- <group col="1" colspan="2" groups="base.group_no_one">
- <button name="%(action_report_internalpreview)d" string="Preview Internal Report" type="action"/>
- <button name="%(action_report_externalpreview)d" string="Preview External Report" type="action"/>
- <button name="edit_external_header" string="Edit external header" type="object" class="oe_link"/>
- <button name="edit_external_footer" string="Edit external footer" type="object" class="oe_link"/>
- <button name="edit_internal_header" string="Edit internal header" type="object" class="oe_link"/>
- </group>
- </xpath>
- </data>
- </field>
- </record>
-
-</odoo>
diff --git a/addons/sale/models/sale_config_settings.py b/addons/sale/models/sale_config_settings.py
index 9b98af88c14..7c407354070 100644
--- a/addons/sale/models/sale_config_settings.py
+++ b/addons/sale/models/sale_config_settings.py
@@ -11,6 +11,9 @@ _logger = logging.getLogger(__name__)
class SaleConfiguration(models.TransientModel):
_inherit = 'sale.config.settings'
+ company_id = fields.Many2one('res.company', string='Company', required=True,
+ default=lambda self: self.env.user.company_id)
+ sale_note = fields.Text(related='company_id.sale_note', string="Default Terms and Conditions *")
group_product_variant = fields.Selection([
(0, "No variants on products"),
(1, 'Products can have several attributes, defining variants (Example: size, color,...)')
diff --git a/addons/sale/views/sale_config_settings_views.xml b/addons/sale/views/sale_config_settings_views.xml
index d384552babc..500aa9bc191 100644
--- a/addons/sale/views/sale_config_settings_views.xml
+++ b/addons/sale/views/sale_config_settings_views.xml
@@ -27,6 +27,8 @@
</div>
</group>
<group string="Quotations &amp; Sales" id="sale" name="quotations_sales">
+ <field name="company_id" invisible="1"/>
+ <field name="sale_note"/>
<field name="group_sale_delivery_address" widget="radio"/>
<field name="group_discount_per_so_line" widget="radio"/>
<field name="module_product_visible_discount" widget="radio" attrs="{'invisible': [('group_discount_per_so_line', '=', False)]}"/>
@@ -47,10 +49,15 @@
<a href="https://www.odoo.com/page/subscriptions" target="_blank"> More Info</a>
</div>
</group>
- <group string="Customers">
+ <group string="Customers" name="customers">
<field name="module_website_quote" widget="radio"/>
</group>
</div>
+ <form name="sale_config_form" position="inside">
+ <div>
+ <span>(*) This configuration value is related to the company you're logged in.</span>
+ </div>
+ </form>
</field>
</record>
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
index 76610f00011..33389e9359a 100644
--- a/addons/sale/views/sale_views.xml
+++ b/addons/sale/views/sale_views.xml
@@ -631,20 +631,6 @@
</record>
-
- <record model="ir.ui.view" id="view_company_inherit_form2">
- <field name="name">res.company.form.inherit</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="model">res.company</field>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group name="sale_grp" string="Sales">
- <field name="sale_note" nolabel="1" placeholder="Default terms &amp; conditions..."/>
- </group>
- </xpath>
- </field>
- </record>
-
<!-- Update account invoice search view!-->
<record id="account_invoice_groupby_inherit" model="ir.ui.view">
<field name="name">account.invoice.groupby</field>
diff --git a/addons/sale_stock/__openerp__.py b/addons/sale_stock/__openerp__.py
index 6acfb6a50b9..c467dbbedda 100644
--- a/addons/sale_stock/__openerp__.py
+++ b/addons/sale_stock/__openerp__.py
@@ -29,7 +29,6 @@ You can choose flexible invoicing methods:
'data': [
'security/sale_stock_security.xml',
'security/ir.model.access.csv',
- 'views/res_company_views.xml',
'views/sale_order_views.xml',
'views/stock_views.xml',
'views/sale_config_settings_views.xml',
diff --git a/addons/sale_stock/models/sale_config_settings.py b/addons/sale_stock/models/sale_config_settings.py
index 992541ac781..5f7f7a8510b 100644
--- a/addons/sale_stock/models/sale_config_settings.py
+++ b/addons/sale_stock/models/sale_config_settings.py
@@ -7,6 +7,7 @@ from odoo import api, fields, models
class SaleConfiguration(models.TransientModel):
_inherit = 'sale.config.settings'
+ security_lead = fields.Float(related='company_id.security_lead', string="Sales Safety Days *")
module_delivery = fields.Selection([
(0, 'No shipping costs on sales orders'),
(1, 'Allow adding shipping costs')
diff --git a/addons/sale_stock/views/res_company_views.xml b/addons/sale_stock/views/res_company_views.xml
deleted file mode 100644
index 96b29e66925..00000000000
--- a/addons/sale_stock/views/res_company_views.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" ?>
-<odoo>
- <data>
- <record id="view_company_form_inherit_sale_stock" model="ir.ui.view">
- <field name="name">res.company.mrp.config</field>
- <field name="model">res.company</field>
- <field name="priority">24</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='logistics_grp']" position="inside">
- <field name="security_lead"/>
- </xpath>
- </field>
- </record>
- </data>
-</odoo>
diff --git a/addons/sale_stock/views/sale_config_settings_views.xml b/addons/sale_stock/views/sale_config_settings_views.xml
index 6909308bf6f..efb287fefd6 100644
--- a/addons/sale_stock/views/sale_config_settings_views.xml
+++ b/addons/sale_stock/views/sale_config_settings_views.xml
@@ -5,6 +5,9 @@
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.view_sales_config"/>
<field name="arch" type="xml">
+ <group name="customers" position="inside">
+ <field name="security_lead"/>
+ </group>
<xpath expr="//div[@id='main']" position="inside">
<group string="Shipping">
<field name="module_delivery" widget="radio"/>
diff --git a/addons/sales_team/views/res_config_view.xml b/addons/sales_team/views/res_config_view.xml
index 53eabbe07f1..73475d196c4 100644
--- a/addons/sales_team/views/res_config_view.xml
+++ b/addons/sales_team/views/res_config_view.xml
@@ -5,7 +5,7 @@
<field name="name">sale settings</field>
<field name="model">sale.config.settings</field>
<field name="arch" type="xml">
- <form string="Configure Sales" class="oe_form_configuration">
+ <form string="Configure Sales" class="oe_form_configuration" name="sale_config_form">
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>