From 83608995e1856b175c1cc1773c40201843392888 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 23 May 2017 13:04:15 +0200 Subject: [PATCH 01/10] [IMP] base: Add 'active' attribute on menuitem tag This attribute will be used in the next commit to hide by default account menuitems in the account module to finally display them in the account_invoicing module. Without this attribute, we should create the menuitems with the tag and after that make them inactive by using a tag --- odoo/import_xml.rng | 1 + odoo/tools/convert.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/odoo/import_xml.rng b/odoo/import_xml.rng index 36546c39946..a343a3133af 100644 --- a/odoo/import_xml.rng +++ b/odoo/import_xml.rng @@ -239,6 +239,7 @@ + diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index 6997a2e1b30..6c0ed8e59bc 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -516,6 +516,8 @@ form: module.record_id""" % (xml_id,) if rec.get('sequence'): values['sequence'] = int(rec.get('sequence')) + values['active'] = self.nodeattr2bool(rec, 'active', default=True) + if rec.get('groups'): g_names = rec.get('groups','').split(',') groups_value = [] From 39d8c4068251537691b39a7b79889db291c9380a Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 23 May 2017 13:04:51 +0200 Subject: [PATCH 02/10] [IMP] sale: Hide all sale menuitems while sale_management isn't installed Hiding the Sales root menuitem isn't sufficient to hide all the menuitems from the sales module. Example: 1/ Install Ecommerce, you don't have any menuitems from sale as sales_management isn't installed 2/ Install CRM, the root menuitem is activated by the sale_crm, and all the menuitems from sales are displayed Specification: Add the attribute active=False on all the menuitems from sales Activate them on sale_management --- addons/sale/report/sale_report_views.xml | 2 +- .../sale/views/sale_layout_category_view.xml | 1 + addons/sale/views/sale_views.xml | 42 +++++++------ .../views/sale_management_views.xml | 59 +++++++++++++++++++ 4 files changed, 81 insertions(+), 23 deletions(-) diff --git a/addons/sale/report/sale_report_views.xml b/addons/sale/report/sale_report_views.xml index 2a660a3616c..f42514261ff 100644 --- a/addons/sale/report/sale_report_views.xml +++ b/addons/sale/report/sale_report_views.xml @@ -94,6 +94,6 @@ This report performs analysis on your quotations and sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application. - + diff --git a/addons/sale/views/sale_layout_category_view.xml b/addons/sale/views/sale_layout_category_view.xml index ecb0bbebb74..d5130bcd515 100644 --- a/addons/sale/views/sale_layout_category_view.xml +++ b/addons/sale/views/sale_layout_category_view.xml @@ -57,5 +57,6 @@ sequence="2" name="Report Layout Categories" groups="sale.group_sale_layout" + active="False" /> diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 93a2051bd91..ca5c95153df 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -8,31 +8,29 @@ --> - - - - + web_icon="sale,static/description/icon.png" + active="False"/> + groups= "sales_team.group_sale_manager,sales_team.group_sale_salesman,account.group_account_manager,account.group_account_user" + active="False"/> - - + + - - - - - - - - - + + + + + + + + + sale.order.calendar @@ -473,7 +471,7 @@ + sequence="12" groups="sales_team.group_sale_salesman,sales_team.group_sale_manager" active="False"/> Orders to Invoice @@ -495,10 +493,10 @@ + sequence="5" active="False"/> + sequence="2" active="False"/> Orders to Upsell @@ -523,7 +521,7 @@ + sequence="5" active="False"/> @@ -550,7 +548,7 @@ + sequence="11" active="False"/> sale.order.line.tree diff --git a/addons/sale_management/views/sale_management_views.xml b/addons/sale_management/views/sale_management_views.xml index 5dd359fb3bb..efd8acc89fa 100644 --- a/addons/sale_management/views/sale_management_views.xml +++ b/addons/sale_management/views/sale_management_views.xml @@ -3,4 +3,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8cd4f48867d27e9046d757e78c9f67d36741bf8b Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 23 May 2017 13:10:34 +0200 Subject: [PATCH 03/10] [ADD] account_invoicing: Hide account menuitems if only website_sale installed Purpose ======= Ease payment setup & flow of ecommerce In Odoo, we have 3 ways to sell: sales -> invoice is needed when you issue quotations eCommerce -> invoice is mostly for B2B but is part of the flow in any case PoS -> invoice is mostly for B2B. It's an option -> make invoicing an option in ecommerce (still working but unvisible) Specification ============= Hide the menuitems of account, and add a module account_invoicing that will display them. --- addons/account/__manifest__.py | 8 ++---- addons/account/views/account_menuitem.xml | 6 +++- addons/account_accountant/__manifest__.py | 2 +- .../data/account_accountant_data.xml | 2 +- addons/account_invoicing/__init__.py | 2 ++ addons/account_invoicing/__manifest__.py | 27 ++++++++++++++++++ .../static/description/account_sc_00.png | Bin .../static/description/account_sc_01.png | Bin .../static/description/account_sc_03.png | Bin .../static/description/account_voucher.png | Bin .../static/description/analysis.png | Bin .../static/description/icon.png | Bin .../static/description/index.html | 0 .../views/account_menuitem_views.xml | 6 ++++ addons/sale_management/__manifest__.py | 2 +- 15 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 addons/account_invoicing/__init__.py create mode 100644 addons/account_invoicing/__manifest__.py rename addons/{account => account_invoicing}/static/description/account_sc_00.png (100%) rename addons/{account => account_invoicing}/static/description/account_sc_01.png (100%) rename addons/{account => account_invoicing}/static/description/account_sc_03.png (100%) rename addons/{account => account_invoicing}/static/description/account_voucher.png (100%) rename addons/{account => account_invoicing}/static/description/analysis.png (100%) rename addons/{account => account_invoicing}/static/description/icon.png (100%) rename addons/{account => account_invoicing}/static/description/index.html (100%) create mode 100644 addons/account_invoicing/views/account_menuitem_views.xml diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index fdb296eb7b1..fd56de27e03 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -6,11 +6,7 @@ 'summary': 'Send Invoices and Track Payments', 'sequence': 30, 'description': """ -Invoicing & Payments -==================== -The specific and easy-to-use Invoicing system in Odoo allows you to keep track of your accounting, even when you are not an accountant. It provides an easy way to follow up on your vendors and customers. - -You could use this simplified accounting in case you work with an (external) account to keep your books, and you still want to keep track of payments. This module also offers you an easy method of registering payments, without having to encode complete abstracts of account. +Core mechanisms for the accounting modules. To display the menuitems, install the module account_invoicing. """, 'category': 'Accounting', 'website': 'https://www.odoo.com/page/billing', @@ -75,7 +71,7 @@ You could use this simplified accounting in case you work with an (external) acc "static/src/xml/account_report_backend.xml", ], 'installable': True, - 'application': True, + 'application': False, 'auto_install': False, 'post_init_hook': '_auto_install_l10n', } diff --git a/addons/account/views/account_menuitem.xml b/addons/account/views/account_menuitem.xml index af0457d9b08..92e59ad21e1 100644 --- a/addons/account/views/account_menuitem.xml +++ b/addons/account/views/account_menuitem.xml @@ -6,9 +6,13 @@ + + + + diff --git a/addons/account_accountant/__manifest__.py b/addons/account_accountant/__manifest__.py index f8af161bd47..d9f442828b4 100644 --- a/addons/account_accountant/__manifest__.py +++ b/addons/account_accountant/__manifest__.py @@ -14,7 +14,7 @@ It gives the Administrator user access to all accounting features such as journa It assigns manager and user access rights to the Administrator for the accounting application and only user rights to the Demo user. """, 'website': 'https://www.odoo.com/page/accounting', - 'depends': ['account', 'web_tour'], + 'depends': ['account_invoicing', 'web_tour'], 'data': [ 'data/account_accountant_data.xml', 'security/account_accountant_security.xml', diff --git a/addons/account_accountant/data/account_accountant_data.xml b/addons/account_accountant/data/account_accountant_data.xml index 11970da9d7d..8bc3efb8d40 100644 --- a/addons/account_accountant/data/account_accountant_data.xml +++ b/addons/account_accountant/data/account_accountant_data.xml @@ -3,7 +3,7 @@ diff --git a/addons/account_invoicing/__init__.py b/addons/account_invoicing/__init__.py new file mode 100644 index 00000000000..67dee8c60db --- /dev/null +++ b/addons/account_invoicing/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. diff --git a/addons/account_invoicing/__manifest__.py b/addons/account_invoicing/__manifest__.py new file mode 100644 index 00000000000..3e1cbd67ef0 --- /dev/null +++ b/addons/account_invoicing/__manifest__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Invoicing Management', + 'version': '1.0', + 'summary': 'Send Invoices and Track Payments', + 'sequence': 30, + 'description': """ +Invoicing & Payments +==================== +The specific and easy-to-use Invoicing system in Odoo allows you to keep track of your accounting, even when you are not an accountant. It provides an easy way to follow up on your vendors and customers. + +You could use this simplified accounting in case you work with an (external) account to keep your books, and you still want to keep track of payments. This module also offers you an easy method of registering payments, without having to encode complete abstracts of account. + """, + 'category': 'Invoicing Management', + 'website': 'https://www.odoo.com/page/billing', + 'depends': ['account'], + 'data': [ + 'views/account_menuitem_views.xml', + ], + 'demo': [ + ], + 'qweb': [ + ], + 'application': True, +} diff --git a/addons/account/static/description/account_sc_00.png b/addons/account_invoicing/static/description/account_sc_00.png similarity index 100% rename from addons/account/static/description/account_sc_00.png rename to addons/account_invoicing/static/description/account_sc_00.png diff --git a/addons/account/static/description/account_sc_01.png b/addons/account_invoicing/static/description/account_sc_01.png similarity index 100% rename from addons/account/static/description/account_sc_01.png rename to addons/account_invoicing/static/description/account_sc_01.png diff --git a/addons/account/static/description/account_sc_03.png b/addons/account_invoicing/static/description/account_sc_03.png similarity index 100% rename from addons/account/static/description/account_sc_03.png rename to addons/account_invoicing/static/description/account_sc_03.png diff --git a/addons/account/static/description/account_voucher.png b/addons/account_invoicing/static/description/account_voucher.png similarity index 100% rename from addons/account/static/description/account_voucher.png rename to addons/account_invoicing/static/description/account_voucher.png diff --git a/addons/account/static/description/analysis.png b/addons/account_invoicing/static/description/analysis.png similarity index 100% rename from addons/account/static/description/analysis.png rename to addons/account_invoicing/static/description/analysis.png diff --git a/addons/account/static/description/icon.png b/addons/account_invoicing/static/description/icon.png similarity index 100% rename from addons/account/static/description/icon.png rename to addons/account_invoicing/static/description/icon.png diff --git a/addons/account/static/description/index.html b/addons/account_invoicing/static/description/index.html similarity index 100% rename from addons/account/static/description/index.html rename to addons/account_invoicing/static/description/index.html diff --git a/addons/account_invoicing/views/account_menuitem_views.xml b/addons/account_invoicing/views/account_menuitem_views.xml new file mode 100644 index 00000000000..947b92fe033 --- /dev/null +++ b/addons/account_invoicing/views/account_menuitem_views.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/addons/sale_management/__manifest__.py b/addons/sale_management/__manifest__.py index 854d82f827c..b498649e819 100644 --- a/addons/sale_management/__manifest__.py +++ b/addons/sale_management/__manifest__.py @@ -41,7 +41,7 @@ The Dashboard for the Sales Manager will include * Monthly Turnover (Graph) """, 'website': 'https://www.odoo.com/page/sales', - 'depends': ['sale'], + 'depends': ['sale', 'account_invoicing'], 'data': [ 'views/sale_management_views.xml', 'views/sale_management_templates.xml', From 2d71a0f4f4251c040e05b1ab22de15b365384266 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 23 May 2017 13:13:39 +0200 Subject: [PATCH 04/10] [IMP] website_sale: Add an option to install account_invoicing The invoicing mechanism can be tranparent for the end users, and can ben activated on the website settings --- addons/website_sale/models/res_config.py | 5 +++-- addons/website_sale/views/res_config_view.xml | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/website_sale/models/res_config.py b/addons/website_sale/models/res_config.py index b30f2751320..629c4f77a52 100644 --- a/addons/website_sale/models/res_config.py +++ b/addons/website_sale/models/res_config.py @@ -39,6 +39,7 @@ class WebsiteConfigSettings(models.TransientModel): module_website_sale_wishlist = fields.Boolean("Wishlists ", help='Installs *e-Commerce Wishlist*') module_website_sale_comparison = fields.Boolean("Product Comparator", help='Installs *e-Commerce Comparator*') + module_account_invoicing = fields.Boolean("Invoicing") module_sale_stock = fields.Boolean("Delivery Orders") # the next 2 fields represent sale_pricelist_setting from sale.config.settings, they are split here for the form view, to improve usability @@ -69,8 +70,8 @@ class WebsiteConfigSettings(models.TransientModel): group='base.group_portal,base.group_user,base.group_public') default_invoice_policy = fields.Selection([ - ('order', 'Ordered quantities'), - ('delivery', 'Delivered quantities or service hours') + ('order', 'Invoice what is ordered (automatic)'), + ('delivery', 'Invoice what is delivered (manual)') ], 'Invoicing Policy', default='order') group_multi_currency = fields.Boolean(string='Multi-Currencies', implied_group='base.group_multi_currency') diff --git a/addons/website_sale/views/res_config_view.xml b/addons/website_sale/views/res_config_view.xml index 707add9ee15..cb270375b89 100644 --- a/addons/website_sale/views/res_config_view.xml +++ b/addons/website_sale/views/res_config_view.xml @@ -220,12 +220,14 @@

Invoicing

-
-
+
+
+ +
-