From 2b0eb7e7b57a02fdebe7582668589ac9d83cf549 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 27 Aug 2015 12:28:11 +0200 Subject: [PATCH] [DEL] sale_journal: deprecated module Reason: complete rewrite of the Sale module. Invoicing is now managed through Sale. Responsible: fp, dbo, nim --- addons/sale_journal/__init__.py | 4 - addons/sale_journal/__openerp__.py | 44 ------- addons/sale_journal/sale_journal.py | 79 ----------- addons/sale_journal/sale_journal_data.xml | 12 -- addons/sale_journal/sale_journal_demo.xml | 18 --- addons/sale_journal/sale_journal_view.xml | 124 ------------------ .../sale_journal/security/ir.model.access.csv | 6 - 7 files changed, 287 deletions(-) delete mode 100644 addons/sale_journal/__init__.py delete mode 100644 addons/sale_journal/__openerp__.py delete mode 100644 addons/sale_journal/sale_journal.py delete mode 100644 addons/sale_journal/sale_journal_data.xml delete mode 100644 addons/sale_journal/sale_journal_demo.xml delete mode 100644 addons/sale_journal/sale_journal_view.xml delete mode 100644 addons/sale_journal/security/ir.model.access.csv diff --git a/addons/sale_journal/__init__.py b/addons/sale_journal/__init__.py deleted file mode 100644 index 7ba4f63b16d..00000000000 --- a/addons/sale_journal/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -import sale_journal diff --git a/addons/sale_journal/__openerp__.py b/addons/sale_journal/__openerp__.py deleted file mode 100644 index 1230751149b..00000000000 --- a/addons/sale_journal/__openerp__.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -{ - 'name': 'Invoicing Journals', - 'version': '1.0', - 'category': 'Sales Management', - 'description': """ -The sales journal modules allows you to categorise your sales and deliveries (picking lists) between different journals. -======================================================================================================================== - -This module is very helpful for bigger companies that works by departments. - -You can use journal for different purposes, some examples: ----------------------------------------------------------- - * isolate sales of different departments - * journals for deliveries by truck or by UPS - -Journals have a responsible and evolves between different status: ------------------------------------------------------------------ - * draft, open, cancel, done. - -Batch operations can be processed on the different journals to confirm all sales -at once, to validate or invoice packing. - -It also supports batch invoicing methods that can be configured by partners and sales orders, examples: -------------------------------------------------------------------------------------------------------- - * daily invoicing - * monthly invoicing - -Some statistics by journals are provided. - """, - 'website': 'https://www.odoo.com/page/billing', - 'depends': ['sale_stock'], - 'data': [ - 'security/ir.model.access.csv', - 'sale_journal_view.xml', - 'sale_journal_data.xml' - ], - 'demo': ['sale_journal_demo.xml'], - 'test': [ ], - 'installable': True, - 'auto_install': False, -} diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py deleted file mode 100644 index 2dff71f92d7..00000000000 --- a/addons/sale_journal/sale_journal.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp.osv import fields, osv - -class sale_journal_invoice_type(osv.osv): - _name = 'sale_journal.invoice.type' - _description = 'Invoice Types' - _columns = { - 'name': fields.char('Invoice Type', required=True), - 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the invoice type without removing it."), - 'note': fields.text('Note'), - 'invoicing_method': fields.selection([('simple', 'Non grouped'), ('grouped', 'Grouped')], 'Invoicing method', required=True), - } - _defaults = { - 'active': True, - 'invoicing_method': 'simple' - } - -#============================================== -# sale journal inherit -#============================================== - -class res_partner(osv.osv): - _inherit = 'res.partner' - _columns = { - 'property_invoice_type': fields.property( - type = 'many2one', - relation = 'sale_journal.invoice.type', - string = "Invoicing Type", - group_name = "Accounting Properties", - help = "This invoicing type will be used, by default, to invoice the current partner."), - } - - def _commercial_fields(self, cr, uid, context=None): - return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['property_invoice_type'] - - -class picking(osv.osv): - _inherit = "stock.picking" - _columns = { - 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True) - } - - -class stock_move(osv.osv): - _inherit = "stock.move" - - def action_confirm(self, cr, uid, ids, context=None): - """ - Pass the invoice type to the picking from the sales order - (Should also work in case of Phantom BoMs when on explosion the original move is deleted, similar to carrier_id on delivery) - """ - procs_to_check = [] - for move in self.browse(cr, uid, ids, context=context): - if move.procurement_id and move.procurement_id.sale_line_id and move.procurement_id.sale_line_id.order_id.invoice_type_id: - procs_to_check += [move.procurement_id] - res = super(stock_move, self).action_confirm(cr, uid, ids, context=context) - pick_obj = self.pool.get("stock.picking") - for proc in procs_to_check: - pickings = list(set([x.picking_id.id for x in proc.move_ids if x.picking_id and not x.picking_id.invoice_type_id])) - if pickings: - pick_obj.write(cr, uid, pickings, {'invoice_type_id': proc.sale_line_id.order_id.invoice_type_id.id}, context=context) - return res - - -class sale(osv.osv): - _inherit = "sale.order" - _columns = { - 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', help="Generate invoice based on the selected option.") - } - - def onchange_partner_id(self, cr, uid, ids, part, context=None): - result = super(sale, self).onchange_partner_id(cr, uid, ids, part, context=context) - if part: - itype = self.pool.get('res.partner').browse(cr, uid, part, context=context).property_invoice_type - if itype: - result['value']['invoice_type_id'] = itype.id - return result diff --git a/addons/sale_journal/sale_journal_data.xml b/addons/sale_journal/sale_journal_data.xml deleted file mode 100644 index 9d305fe9912..00000000000 --- a/addons/sale_journal/sale_journal_data.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - property_invoice_type - - - - - - diff --git a/addons/sale_journal/sale_journal_demo.xml b/addons/sale_journal/sale_journal_demo.xml deleted file mode 100644 index 061a5af8544..00000000000 --- a/addons/sale_journal/sale_journal_demo.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Daily invoicing - - - Monthly invoicing - grouped - - - - - - - - diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml deleted file mode 100644 index a0f4e9b72f0..00000000000 --- a/addons/sale_journal/sale_journal_view.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - sale_journal.invoice.type.form - sale_journal.invoice.type - -
- - - - - - - - - -
- - - - - sale_journal.invoice.type.tree - sale_journal.invoice.type - - - - - - - - - - - - Invoice Types - sale_journal.invoice.type - form - tree,form - Invoice types are used for partners, sales orders and delivery orders. You can create a specific invoicing journal to group your invoicing according to your customer's needs: daily, each Wednesday, monthly, etc. - - - - - - - - sale.order.journal.view.form - sale.order - - - - - - - - - - - - sale.order.journal.view.tree - sale.order - - - - - - - - - - - - stock.picking.journal.view.form - stock.picking - - - - - - - - - - - - res.partner.journal.property.form.inherit - res.partner - - - - - - - - - - sale.order.search.inherit - sale.order - - - - - - - - - - - - stock.picking.internal.search.inherit - stock.picking - - - - - - - - -
-
diff --git a/addons/sale_journal/security/ir.model.access.csv b/addons/sale_journal/security/ir.model.access.csv deleted file mode 100644 index 377e78b8c37..00000000000 --- a/addons/sale_journal/security/ir.model.access.csv +++ /dev/null @@ -1,6 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_sale_journal_invoice_type_finance_invoice,sale_journal.invoice.type invoice,model_sale_journal_invoice_type,account.group_account_invoice,1,1,1,1 -access_sale_journal_invoice_type_partner_manager,sale_journal.invoice.type partner manager,model_sale_journal_invoice_type,base.group_partner_manager,1,0,0,0 -access_sale_journal_invoice_type_salesman,sale_journal.invoice.type salesman,model_sale_journal_invoice_type,base.group_sale_salesman,1,0,0,0 -access_sale_journal_invoice_type_manager,sale_journal.invoice.type.manager,model_sale_journal_invoice_type,base.group_sale_manager,1,1,1,1 -access_sale_journal_invoice_type_stock_worker,sale_journal.invoice_type stock worker,model_sale_journal_invoice_type,stock.group_stock_user,1,0,0,0