diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 60d30f9fff0..bbbbb5c491f 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -3,15 +3,15 @@
- account.analytic.account.invoice.stat.form.inherit
- account.analytic.account
- form
+ account.analytic.account.invoice.stat.form.inherit
+ account.analytic.account
+ form
@@ -30,9 +30,9 @@
- account.analytic.account.invoice.form.inherit
- account.analytic.account
- form
+ account.analytic.account.invoice.form.inherit
+ account.analytic.account
+ form
@@ -69,7 +69,7 @@
-
+
@@ -97,19 +97,33 @@
-
-
- account.analytic.account.tree
- account.analytic.account
+
+
+ account.analytic.account.tree
+ account.analytic.account
- tree
-
-
+ tree
+
+
+
+ Sales Application
+ sale.config.settings
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/base_setup/base_setup_views.xml b/addons/base_setup/base_setup_views.xml
index 63bf79b37d7..442986cff61 100644
--- a/addons/base_setup/base_setup_views.xml
+++ b/addons/base_setup/base_setup_views.xml
@@ -142,18 +142,19 @@
1
-
+ sale.config.settingssale.config.settingsform
@@ -162,9 +163,9 @@
Configure Sales & CRMir.actions.act_windowsale.config.settings
-
- form
+ form
+ new
diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py
index 214c5c3d450..95cf8b53f27 100644
--- a/addons/crm/__init__.py
+++ b/addons/crm/__init__.py
@@ -28,6 +28,7 @@ import crm_phonecall
import report
import wizard
import res_partner
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index 4968176e826..5f71c404976 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -111,6 +111,8 @@ Creates a dashboard for CRM that includes:
'res_partner_view.xml',
'board_crm_statistical_view.xml',
'board_crm_view.xml',
+
+ 'res_config_view.xml',
],
'demo_xml': [
diff --git a/addons/crm/res_config.py b/addons/crm/res_config.py
new file mode 100644
index 00000000000..66b83a75f18
--- /dev/null
+++ b/addons/crm/res_config.py
@@ -0,0 +1,126 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class crm_configuration(osv.osv_memory):
+ _inherit = 'sale.config.settings'
+
+ _columns = {
+ 'module_crm_caldav': fields.boolean("Caldav Synchronization",
+ help="""Use protocol caldav to synchronize meetings with other calendar applications (like Sunbird).
+ This installs the module crm_caldav."""),
+ 'fetchmail_crm': fields.boolean("Lead/Opportunity mail gateway",
+ help="Create leads automatically from an email gateway."),
+ 'default_server': fields.char('Server Name', size=256),
+ 'default_port': fields.integer('Port'),
+ 'default_type': fields.selection([
+ ('pop', 'POP Server'),
+ ('imap', 'IMAP Server'),
+ ('local', 'Local Server'),
+ ], 'Server Type'),
+ 'default_is_ssl': fields.boolean('SSL/TLS',
+ help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP=995)"),
+ 'default_user': fields.char('Username', size=256),
+ 'default_password': fields.char('Password', size=1024),
+ 'module_import_sugarcrm': fields.boolean("SugarCRM Import",
+ help="""Import SugarCRM leads, opportunities, users, accounts, contacts, employees, meetings, phonecalls, emails, project and project tasks data.
+ This installs the module import_sugarcrm."""),
+ 'module_import_google': fields.boolean("Google Import",
+ help="""Import google contact in partner address and add google calendar events details in Meeting.
+ This installs the module import_google."""),
+ 'module_wiki_sale_faq': fields.boolean("Install a sales FAQ",
+ help="""This provides demo data, thereby creating a Wiki Group and a Wiki Page for Wiki Sale FAQ.
+ This installs the module wiki_sale_faq."""),
+ 'module_base_contact': fields.boolean("Manage a several addresses per customer",
+ help="""Lets you define:
+ * contacts unrelated to a partner,
+ * contacts working at several addresses (possibly for different partners),
+ * contacts with possibly different job functions.
+ This installs the module base_contact."""),
+ 'module_google_map': fields.boolean("Google maps on customer",
+ help="""Locate customers on Google Map.
+ This installs the module google_map."""),
+ }
+
+ _defaults = {
+ 'default_type': 'pop',
+ }
+
+ def onchange_server_type(self, cr, uid, ids, server_type, ssl, context=None):
+ values = {}
+ if server_type == 'pop':
+ values['default_port'] = ssl and 995 or 110
+ elif server_type == 'imap':
+ values['default_port'] = ssl and 993 or 143
+ else:
+ values['default_server'] = False
+ values['default_port'] = 0
+ return {'value': values}
+
+ def get_default_email_configurations(self, cr, uid, ids, context=None):
+ ir_values = self.pool.get('ir.values')
+ server_count = self.pool.get('fetchmail.server').search(cr, uid,
+ [('name','=','Incoming Leads'), ('state','=','done')], count=True)
+ return {
+ 'fetchmail_crm': bool(server_count),
+ 'default_server': ir_values.get_default(cr, uid, 'fetchmail.server', 'server') or False,
+ 'default_port': ir_values.get_default(cr, uid, 'fetchmail.server', 'port') or False,
+ 'default_type': ir_values.get_default(cr, uid, 'fetchmail.server', 'type') or False,
+ 'default_is_ssl': ir_values.get_default(cr, uid, 'fetchmail.server', 'is_ssl') or False,
+ 'default_user': ir_values.get_default(cr, uid, 'fetchmail.server', 'user') or False,
+ 'default_password': ir_values.get_default(cr, uid, 'fetchmail.server', 'password') or False,
+ }
+
+ def set_email_configurations(self, cr, uid, ids, context=None):
+ ir_values = self.pool.get('ir.values')
+ fetchmail_obj = self.pool.get('fetchmail.server')
+ config = self.browse(cr, uid, ids[0], context)
+ model_ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'crm.lead')])
+ if config.fetchmail_crm and model_ids:
+ fetchmail_vals = {
+ 'name': 'Incoming Leads',
+ 'object_id': model_ids[0],
+ 'server': config.default_server,
+ 'port': config.default_port,
+ 'is_ssl': config.default_is_ssl,
+ 'type': config.default_type,
+ 'user': config.default_user,
+ 'password': config.default_password,
+ }
+ server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads'), ('state','=','done')])
+ if not server_ids:
+ server_ids = [fetchmail_obj.create(cr, uid, fetchmail_vals, context=context)]
+ else:
+ server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads')], context=context)
+ fetchmail_obj.write(cr, uid, server_ids, fetchmail_vals, context=context)
+ fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'server', config.default_server)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'port', config.default_port)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'is_ssl', config.default_is_ssl)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'type', config.default_type)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'user', config.default_user)
+ ir_values.set_default(cr, uid, 'fetchmail.server', 'password', config.default_password)
+ else:
+ server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads'), ('state','=','done')])
+ fetchmail_obj.set_draft(cr, uid, server_ids, context=None)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/res_config_view.xml b/addons/crm/res_config_view.xml
new file mode 100644
index 00000000000..32d84ce3b67
--- /dev/null
+++ b/addons/crm/res_config_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ Sales Application
+ sale.config.settings
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py
index 9f95a430f4e..77193cde2bf 100644
--- a/addons/delivery/delivery.py
+++ b/addons/delivery/delivery.py
@@ -106,7 +106,7 @@ class delivery_carrier(osv.osv):
# if using advanced pricing per destination: do not change
if record.use_detailed_pricelist:
continue
-
+
# not using advanced pricing per destination: override grid
grid_id = grid_pool.search(cr, uid, [('carrier_id', '=', record.id)], context=context)
@@ -250,23 +250,4 @@ class delivery_grid_line(osv.osv):
delivery_grid_line()
-class define_delivery_steps(osv.osv_memory):
- _name = 'delivery.define.delivery.steps.wizard'
-
- _columns = {
- 'picking_policy' : fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], 'Picking Policy'),
- }
- _defaults = {
- 'picking_policy': lambda s,c,u,ctx: s.pool.get('sale.order').default_get(c,u,['picking_policy'],context=ctx)['picking_policy']
- }
-
- def apply_cb(self, cr, uid, ids, context=None):
- ir_values_obj = self.pool.get('ir.values')
- wizard = self.browse(cr, uid, ids, context=context)[0]
- ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], wizard.picking_policy)
- return {'type' : 'ir.actions.act_window_close'}
-
-define_delivery_steps()
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index 1e47d815084..5d6d9cd2d40 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -337,35 +337,5 @@
10
-
- delivery.define_delivery_steps
- delivery.define.delivery.steps.wizard
- form
-
-
-
-
-
-
- Setup Your Picking Policy
- delivery.define.delivery.steps.wizard
- form
- form
- new
-
-
-
-
-
- once
-
diff --git a/addons/delivery/test/delivery_cost.yml b/addons/delivery/test/delivery_cost.yml
index f8d6787a0c5..521f260e136 100644
--- a/addons/delivery/test/delivery_cost.yml
+++ b/addons/delivery/test/delivery_cost.yml
@@ -67,9 +67,9 @@
-
I set default delivery policy.
-
- !record {model: delivery.define.delivery.steps.wizard, id: default_delivery_policy}:
+ !record {model: sale.config.settings, id: default_delivery_policy}:
{}
-
- !python {model: delivery.define.delivery.steps.wizard}: |
- self.apply_cb(cr, uid, [ref('default_delivery_policy')], context=context)
+ !python {model: sale.config.settings}: |
+ self.execute(cr, uid, [ref('default_delivery_policy')], context=context)
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
index 3190b8910ae..30cafc5a0b4 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py
index 4787883ef9c..72164b89865 100644
--- a/addons/mail/__init__.py
+++ b/addons/mail/__init__.py
@@ -23,6 +23,7 @@ import mail_message
import mail_thread
import res_partner
import wizard
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index 8085d301364..1cad3fafa5d 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -62,6 +62,7 @@ The main features are:
"res_partner_view.xml",
'security/ir.model.access.csv',
'mail_data.xml',
+ 'res_config_view.xml',
],
'installable': True,
'auto_install': False,
diff --git a/addons/mail/res_config.py b/addons/mail/res_config.py
new file mode 100644
index 00000000000..89038a43610
--- /dev/null
+++ b/addons/mail/res_config.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class plugin_configuration(osv.osv_memory):
+ _inherit = 'sale.config.settings'
+
+ _columns = {
+ 'module_plugin_thunderbird': fields.boolean('Thunderbird plugin',
+ help="""The plugin allows you archive email and its attachments to the selected
+ OpenERP objects. You can select a partner, a task, a project, an analytical
+ account, or any other object and attach the selected mail as a .eml file in
+ the attachment of a selected record. You can create documents for CRM Lead,
+ HR Applicant and Project Issue from the selected emails.
+ This installs the module plugin_thunderbird."""),
+ 'module_plugin_outlook': fields.boolean('Outlook plugin',
+ help="""The Outlook plugin allows you to select an object that you would like to add
+ to your email and its attachments from MS Outlook. You can select a partner, a task,
+ a project, an analytical account, or any other object and archive a selected
+ email into an OpenERP mail message with attachments.
+ This installs the module plugin_outlook."""),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/res_config_view.xml b/addons/mail/res_config_view.xml
new file mode 100644
index 00000000000..2610538da42
--- /dev/null
+++ b/addons/mail/res_config_view.xml
@@ -0,0 +1,20 @@
+
+
+
+
+ Sales Application
+ sale.config.settings
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml
index fa0ff192f17..dd29de20f9b 100644
--- a/addons/mrp_repair/mrp_repair_view.xml
+++ b/addons/mrp_repair/mrp_repair_view.xml
@@ -118,7 +118,7 @@
diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml
index 37b924f319f..429fbf97a32 100644
--- a/addons/plugin_outlook/plugin_outlook.xml
+++ b/addons/plugin_outlook/plugin_outlook.xml
@@ -48,11 +48,17 @@
new
-
-
-
- 4
- automatic
+
+
+ Sales Application
+ sale.config.settings
+ form
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml
index 3b4107c8358..ee4801d8925 100644
--- a/addons/plugin_thunderbird/plugin_thunderbird.xml
+++ b/addons/plugin_thunderbird/plugin_thunderbird.xml
@@ -54,11 +54,18 @@
formnew
-
-
-
- 3
- automatic
+
+
+
+ Sales Application
+ sale.config.settings
+ form
+
+
+
+
+
+
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 5461bf690bd..f23249c6afc 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -80,7 +80,7 @@
-
+
diff --git a/addons/product/__init__.py b/addons/product/__init__.py
index 4247b49d41b..a7e0be09dc5 100644
--- a/addons/product/__init__.py
+++ b/addons/product/__init__.py
@@ -23,5 +23,6 @@ import pricelist
import report
import partner
import wizard
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 51d012b8577..4d917230acc 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml
index 3ddfe1e6900..c36f2082ff5 100644
--- a/addons/product/pricelist_view.xml
+++ b/addons/product/pricelist_view.xml
@@ -4,7 +4,8 @@
-
+
product.pricelist.version.form
@@ -195,7 +196,7 @@
-
+
Price Typesir.actions.act_window
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index a1857748b9d..2eaf0ead9e0 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -20,7 +20,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -125,11 +125,11 @@
-
+
-
+
@@ -440,7 +440,7 @@
Create and manage the units of measure you want to be used in your system. You can define a conversion rate between several Units of Measure within the same category.
-
+
@@ -552,7 +552,7 @@
-
+
@@ -674,11 +674,11 @@
-
+
-
+
diff --git a/addons/product/res_config.py b/addons/product/res_config.py
new file mode 100644
index 00000000000..6af8c9c26be
--- /dev/null
+++ b/addons/product/res_config.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class sale_config_settings(osv.osv_memory):
+ _inherit = 'sale.config.settings'
+
+ _columns = {
+ 'group_sale_pricelist':fields.boolean("Pricelist per Customer",
+ implied_group='product.group_sale_pricelist',
+ help="""Allows to manage different prices based on rules per category of customers.
+ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""),
+ 'group_purchase_pricelist':fields.boolean("Pricelist per Supplier",
+ implied_group='product.group_purchase_pricelist',
+ help="""Allows to manage different prices based on rules per category of Supplier.
+ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""),
+ 'group_sale_uom':fields.boolean("UOM per product",
+ implied_group='product.group_uom',
+ help="""Allows you to select and maintain different unit of measures per product."""),
+ 'group_stock_packaging':fields.boolean("Manage packaging by products",
+ implied_group='product.group_packaging',
+ help=""" Allows you to create and manage your packaging dimensions and types you want to be maintained in your system."""),
+}
diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml
index 5c993b9cd61..c8c8b1904e8 100644
--- a/addons/product/security/product_security.xml
+++ b/addons/product/security/product_security.xml
@@ -19,6 +19,26 @@
+
+ Sales Pricelists
+
+
+
+
+ Purchase Pricelists
+
+
+
+
+ Multiple UoM per Product
+
+
+
+
+ Manage Product Packaging
+
+
+
product pricelist company rule
diff --git a/addons/product/wizard/product_price_view.xml b/addons/product/wizard/product_price_view.xml
index 91fb931b6fa..adc63de872d 100644
--- a/addons/product/wizard/product_price_view.xml
+++ b/addons/product/wizard/product_price_view.xml
@@ -31,6 +31,7 @@
name="Price List"
res_model="product.price_list"
src_model="product.product"
+ groups="product.group_sale_pricelist"
view_mode="form" target="new" view_type="form" />
diff --git a/addons/project_timesheet/project_timesheet_view.xml b/addons/project_timesheet/project_timesheet_view.xml
index 07873c00592..7a7d4966bf2 100644
--- a/addons/project_timesheet/project_timesheet_view.xml
+++ b/addons/project_timesheet/project_timesheet_view.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py
index b26486e1425..2688b61ddd9 100644
--- a/addons/sale/__init__.py
+++ b/addons/sale/__init__.py
@@ -29,5 +29,6 @@ import wizard
import report
import company
import edi
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index ff2cfb03f5f..e1b3c57de00 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -85,6 +85,7 @@ Dashboard for Sales Manager that includes:
'process/sale_process.xml',
'board_sale_view.xml',
'edi/sale_order_action_data.xml',
+ 'res_config_view.xml',
],
'demo_xml': ['sale_demo.xml'],
'test': [
diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py
new file mode 100644
index 00000000000..37bc0216e88
--- /dev/null
+++ b/addons/sale/res_config.py
@@ -0,0 +1,156 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+import pooler
+from tools.translate import _
+
+class sale_configuration(osv.osv_memory):
+ _inherit = 'sale.config.settings'
+
+ _columns = {
+ 'group_invoice_so_lines': fields.boolean('Based on Sales Orders',
+ implied_group='sale.group_invoice_so_lines',
+ help="To allow your salesman to make invoices for sale order lines using the menu 'Lines to Invoice'."),
+ 'group_invoice_deli_orders': fields.boolean('Based on Delivery Orders',
+ implied_group='sale.group_invoice_deli_orders',
+ help="To allow your salesman to make invoices for Delivery Orders using the menu 'Deliveries to Invoice'."),
+ 'task_work': fields.boolean('Based on Tasks\' Work',
+ help="""Lets you transfer the entries under tasks defined for Project Management to
+ the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways
+ and to automatically creates project tasks from procurement lines.
+ This installs the modules project_timesheet and project_mrp."""),
+ 'module_account_analytic_analysis': fields.boolean('Based on Timesheet',
+ help = """For modifying account analytic view to show important data to project manager of services companies.
+ You can also view the report of account analytic summary user-wise as well as month wise.
+ This installs the module account_analytic_analysis."""),
+ 'default_order_policy': fields.selection(
+ [('manual', 'Invoice Based on Sales Orders'), ('picking', 'Invoice Based on Deliveries')],
+ 'Main Method Based On', required=True, default_model='sale.order',
+ help="You can generate invoices based on sales orders or based on shippings."),
+ 'module_delivery': fields.boolean('Charge delivery costs',
+ help ="""Allows you to add delivery methods in sale orders and delivery orders.
+ You can define your own carrier and delivery grids for prices.
+ This installs the module delivery."""),
+ 'time_unit': fields.many2one('product.uom', 'Working Time Unit'),
+ 'default_picking_policy' : fields.boolean("Deliver all products at once",
+ help = "You can set picking policy on sale order that will allow you to deliver all products at once."),
+ 'group_sale_delivery_address': fields.boolean("Specify delivery and invoice addresses",
+ implied_group='sale.group_delivery_invoice_address',
+ help="Allows you to specify different delivery and invoice addresses on a sale order."),
+ 'group_discount_per_so_line': fields.boolean("Discount per sale order line",
+ implied_group='sale.group_discount_per_so_line',
+ help="Allows you to apply discount per sale order line."),
+ 'module_sale_layout': fields.boolean("Notes & subtotals per line",
+ help="""Allows to format sale order lines using notes, separators, titles and subtotals.
+ This installs the module sale_layout."""),
+ 'module_warning': fields.boolean("Alerts by products or customers",
+ help="""To raise user specific warning messages on different products used in Sales Orders, Purchase Orders, Invoices and Deliveries.
+ This installs the module warning."""),
+ 'module_sale_margin': fields.boolean("Display Margins For Users",
+ help="""This adds the 'Margin' on sales order.
+ This gives the profitability by calculating the difference between the Unit Price and Cost Price.
+ This installs the module sale_margin."""),
+ 'module_sale_journal': fields.boolean("Invoice Journal",
+ help="""Allows you to categorize your sales and deliveries (picking lists) between different journals.
+ This installs the module sale_journal."""),
+ 'module_analytic_user_function': fields.boolean("User function by contracts",
+ help="""Allows you to define what is the default function of a specific user on a given account.
+ This is mostly used when a user encodes his timesheet. The values are retrieved and the fields are auto-filled.
+ But the possibility to change these values is still available.
+ This installs the module analytic_user_function."""),
+ 'module_analytic_journal_billing_rate': fields.boolean("Billing rates by contracts",
+ help="""Allows you to define the default invoicing rate for a specific journal on a given account.
+ This installs the module analytic_journal_billing_rate."""),
+ 'tax_policy': fields.selection(
+ [('no_tax', 'No Tax'), ('global_on_order', 'Global On Order'), ('on_order_line', 'On Order Lines')],
+ 'Taxes', required=True,
+ help="""Choose between either applying global taxes on a sale order, or applying different taxes on sale order lines, or applying no tax at all.""")
+ 'group_sale_taxes_global_on_order': fields.boolean("Global on order",
+ implied_group='sale.group_taxes_global_on_order'),
+ 'group_sale_taxes_on_order_line': fields.boolean("On order line",
+ implied_group='sale.group_taxes_on_order_line'),
+ 'module_project_timesheet': fields.boolean("Project Timesheet"),
+ 'module_project_mrp': fields.boolean("Project MRP"),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ ir_model_data = self.pool.get('ir.model.data')
+ res = super(sale_configuration, self).default_get(cr, uid, fields, context)
+ # task_work, time_unit and tax_policy depend on other fields
+ res['task_work'] = res.get('module_project_mrp') and res.get('module_project_timesheet')
+ if res.get('module_account_analytic_analysis'):
+ product = ir_model_data.get_object(cr, uid, 'product', 'product_consultant')
+ res['time_unit'] = product.uom_id.id
+ res['tax_policy'] = \
+ (res.get('group_sale_taxes_global_on_order') and 'global_on_order') or \
+ (res.get('group_sale_taxes_on_order_line') and 'on_order_line') or \
+ 'no_tax'
+ return res
+
+ def get_default_sale_config(self, cr, uid, ids, context=None):
+ ir_values = self.pool.get('ir.values')
+ default_picking_policy = ir_values.get_default(cr, uid, 'sale.order', 'picking_policy')
+ return {
+ 'default_picking_policy': default_picking_policy == 'one',
+ }
+
+ def _get_default_time_unit(self, cr, uid, context=None):
+ ids = self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=context)
+ return ids and ids[0] or False
+
+ _defaults = {
+ 'default_order_policy': 'manual',
+ 'time_unit': _get_default_time_unit,
+ 'tax_policy': 'global_on_order',
+ }
+
+ def set_sale_defaults(self, cr, uid, ids, context=None):
+ ir_values = self.pool.get('ir.values')
+ ir_model_data = self.pool.get('ir.model.data')
+ wizard = self.browse(cr, uid, ids)[0]
+
+ default_picking_policy = 'one' if wizard.default_picking_policy else 'direct'
+ ir_values.set_default(cr, uid, 'sale.order', 'picking_policy', default_picking_policy)
+
+ if wizard.time_unit:
+ product = ir_model_data.get_object(cr, uid, 'product', 'product_consultant')
+ product.write({'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
+
+ if wizard.task_work and wizard.time_unit:
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ user.company_id.write({'project_time_mode_id': wizard.time_unit.id})
+
+ return {}
+
+ def onchange_task_work(self, cr, uid, ids, task_work, context=None):
+ return {'value': {
+ 'module_project_timesheet': task_work,
+ 'module_project_mrp': task_work,
+ }}
+
+ def onchange_tax_policy(self, cr, uid, ids, tax_policy, context=None):
+ return {'value': {
+ 'group_sale_taxes_global_on_order': tax_policy == 'global_on_order',
+ 'group_sale_taxes_on_order_line': tax_policy == 'on_order_line',
+ }}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/res_config_view.xml b/addons/sale/res_config_view.xml
new file mode 100644
index 00000000000..ab3d34a7096
--- /dev/null
+++ b/addons/sale/res_config_view.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Sales Application
+ sale.config.settings
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 82bfda7b580..f52c2112ac3 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -1330,95 +1330,4 @@ class sale_order_line(osv.osv):
sale_order_line()
-class sale_config_picking_policy(osv.osv_memory):
- _name = 'sale.config.picking_policy'
- _inherit = 'res.config'
-
- _columns = {
- 'name': fields.char('Name', size=64),
- 'sale_orders': fields.boolean('Based on Sales Orders',),
- 'deli_orders': fields.boolean('Based on Delivery Orders'),
- 'task_work': fields.boolean('Based on Tasks\' Work'),
- 'timesheet': fields.boolean('Based on Timesheet'),
- 'order_policy': fields.selection([
- ('manual', 'Invoice Based on Sales Orders'),
- ('picking', 'Invoice Based on Deliveries'),
- ], 'Main Method Based On', required=True, help="You can generate invoices based on sales orders or based on shippings."),
- 'charge_delivery': fields.boolean('Do you charge the delivery?'),
- 'time_unit': fields.many2one('product.uom','Main Working Time Unit')
- }
- _defaults = {
- 'order_policy': 'manual',
- 'time_unit': lambda self, cr, uid, c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c) and self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c)[0] or False,
- }
-
- def onchange_order(self, cr, uid, ids, sale, deli, context=None):
- res = {}
- if sale:
- res.update({'order_policy': 'manual'})
- elif deli:
- res.update({'order_policy': 'picking'})
- return {'value':res}
-
- def execute(self, cr, uid, ids, context=None):
- ir_values_obj = self.pool.get('ir.values')
- data_obj = self.pool.get('ir.model.data')
- menu_obj = self.pool.get('ir.ui.menu')
- module_obj = self.pool.get('ir.module.module')
- module_upgrade_obj = self.pool.get('base.module.upgrade')
- module_name = []
-
- group_id = data_obj.get_object(cr, uid, 'base', 'group_sale_salesman').id
-
- wizard = self.browse(cr, uid, ids)[0]
-
- if wizard.sale_orders:
- menu_id = data_obj.get_object(cr, uid, 'sale', 'menu_invoicing_sales_order_lines').id
- menu_obj.write(cr, uid, menu_id, {'groups_id':[(4,group_id)]})
-
- if wizard.deli_orders:
- menu_id = data_obj.get_object(cr, uid, 'sale', 'menu_action_picking_list_to_invoice').id
- menu_obj.write(cr, uid, menu_id, {'groups_id':[(4,group_id)]})
-
- if wizard.task_work:
- module_name.append('project_timesheet')
- module_name.append('project_mrp')
- module_name.append('account_analytic_analysis')
-
- if wizard.timesheet:
- module_name.append('account_analytic_analysis')
-
- if wizard.charge_delivery:
- module_name.append('delivery')
-
- if len(module_name):
- module_ids = []
- need_install = False
- module_ids = []
- for module in module_name:
- data_id = module_obj.name_search(cr, uid , module, [], '=')
- module_ids.append(data_id[0][0])
-
- for module in module_obj.browse(cr, uid, module_ids):
- if module.state == 'uninstalled':
- module_obj.state_update(cr, uid, [module.id], 'to install', ['uninstalled'], context)
- need_install = True
- cr.commit()
- if need_install:
- pooler.restart_pool(cr.dbname, update_module=True)[1]
-
- if wizard.time_unit:
- prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
- product_obj = self.pool.get('product.product')
- product_obj.write(cr, uid, prod_id, {'uom_id':wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
-
- ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], wizard.order_policy)
- if wizard.task_work and wizard.time_unit:
- company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
- self.pool.get('res.company').write(cr, uid, [company_id], {
- 'project_time_mode_id': wizard.time_unit.id
- }, context=context)
-
-sale_config_picking_policy()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 90d3838f5a0..be15820da71 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -21,7 +21,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
@@ -117,9 +117,9 @@
-
-
-
+
+
+
@@ -139,7 +139,7 @@
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
+ nolabel="1" groups="product.group_uom"/>
@@ -149,11 +149,12 @@
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)"
domain="[('product_id','=',product_id)]" groups="base.group_extended"
colspan="3"/>
-
-
-
-
-
+
+
+
+
+
@@ -183,18 +184,19 @@
-
+
-
+
-
+
-
-
+
+
+
@@ -240,8 +242,8 @@
-
-
+
+
@@ -361,9 +363,9 @@
-
+
-
+
@@ -382,7 +384,7 @@
-
+
@@ -390,11 +392,11 @@
-
-
+
+
-
-
+
+
@@ -499,69 +501,7 @@
groups="base.group_sale_salesman"/>
-
-
-
-
-
- Setup Your Invoicing Method
- sale.config.picking_policy
- form
-
-
-
-
-
-
- Setup your Invoicing Method
-
-
- This tool will help you to install the right module and configure the system according to the method you use to invoice your customers.
-
-
-
- 12
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Setup your Invoicing Method
- ir.actions.act_window
- sale.config.picking_policy
-
- form
- form
- new
-
-
-
-
-
-
- once
-
+
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index ae8c8bf62e3..ee45aa65463 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -20,6 +20,36 @@
+
+ Enable Invoicing Sale order lines
+
+
+
+
+ Enable Invoicing Delivery orders
+
+
+
+
+ Addresses in Sale Orders
+
+
+
+
+ Discount on lines
+
+
+
+
+ Sales Taxes Global on Order
+
+
+
+
+ Sales Taxes on Order Lines
+
+
+
diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml
index 7b9e90f6f0a..fdc7b29acc8 100644
--- a/addons/sale/stock_view.xml
+++ b/addons/sale/stock_view.xml
@@ -74,7 +74,7 @@
{'default_type': 'out', 'contact_display': 'partner_address', 'search_default_to_invoice': 1, 'search_default_done': 1}
-
+
diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml
index d997e792696..bb197763486 100644
--- a/addons/sale/test/manual_order_policy.yml
+++ b/addons/sale/test/manual_order_policy.yml
@@ -82,8 +82,8 @@
-
I set order policy "Deliver & invoice on demand" as default policy.
-
- !record {model: sale.config.picking_policy, id: sale.config.picking_policy_0}:
- order_policy: 'manual'
+ !record {model: sale.config.settings, id: sale_configuration_0}:
+ default_order_policy: 'manual'
-
- !python {model: sale.config.picking_policy}: |
- self.execute(cr, uid, [ref("sale.config.picking_policy_0")])
+ !python {model: sale.config.settings}: |
+ self.execute(cr, uid, [ref("sale_configuration_0")], context=context)
diff --git a/addons/sale_layout/sale_layout_view.xml b/addons/sale_layout/sale_layout_view.xml
index 78f98d3002f..146ca8aa006 100644
--- a/addons/sale_layout/sale_layout_view.xml
+++ b/addons/sale_layout/sale_layout_view.xml
@@ -37,6 +37,7 @@
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
@@ -99,7 +100,7 @@
-
+