From b468ebc6b79496149aeeabdf3cf7d40f98d58414 Mon Sep 17 00:00:00 2001
From: Nicolas Martinelli <nim@odoo.com>
Date: Thu, 27 Aug 2015 12:25:31 +0200
Subject: [PATCH] [DEL] sale_analytic_plans: deprecated module

Reason: complete rewrite of the Sale module. Invoicing is now managed through
Sale.

Responsible: fp, dbo, nim
---
 addons/sale_analytic_plans/__init__.py        |  8 ---
 addons/sale_analytic_plans/__openerp__.py     | 20 -------
 addons/sale_analytic_plans/res_config.xml     |  8 ---
 .../sale_analytic_plans.py                    | 20 -------
 .../sale_analytic_plans_view.xml              | 59 -------------------
 5 files changed, 115 deletions(-)
 delete mode 100644 addons/sale_analytic_plans/__init__.py
 delete mode 100644 addons/sale_analytic_plans/__openerp__.py
 delete mode 100644 addons/sale_analytic_plans/res_config.xml
 delete mode 100644 addons/sale_analytic_plans/sale_analytic_plans.py
 delete mode 100644 addons/sale_analytic_plans/sale_analytic_plans_view.xml

diff --git a/addons/sale_analytic_plans/__init__.py b/addons/sale_analytic_plans/__init__.py
deleted file mode 100644
index 9b3bcaca4ada..000000000000
--- a/addons/sale_analytic_plans/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-#----------------------------------------------------------
-# Init Sales
-#----------------------------------------------------------
-
-import sale_analytic_plans
diff --git a/addons/sale_analytic_plans/__openerp__.py b/addons/sale_analytic_plans/__openerp__.py
deleted file mode 100644
index 878d1e94f7d1..000000000000
--- a/addons/sale_analytic_plans/__openerp__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-{
-    'name': 'Sales Analytic Distribution',
-    'version': '1.0',
-    'category': 'Sales Management',
-    'description': """
-The base module to manage analytic distribution and sales orders.
-=================================================================
-
-Using this module you will be able to link analytic accounts to sales orders.
-    """,
-    'website': 'https://www.odoo.com/page/crm',
-    'depends': ['sale', 'account_analytic_plans'],
-    'data': ['sale_analytic_plans_view.xml','res_config.xml'],
-    'demo': [],
-    'installable': True,
-    'auto_install': False,
-}
diff --git a/addons/sale_analytic_plans/res_config.xml b/addons/sale_analytic_plans/res_config.xml
deleted file mode 100644
index 9fe2b5bb622b..000000000000
--- a/addons/sale_analytic_plans/res_config.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
-
-<record id="base.group_user" model="res.groups">
-    <field name="implied_ids" eval="[(4, ref('sale.group_analytic_accounting'))]"/>
-</record>
-
-</odoo>
diff --git a/addons/sale_analytic_plans/sale_analytic_plans.py b/addons/sale_analytic_plans/sale_analytic_plans.py
deleted file mode 100644
index 7ce9560cb058..000000000000
--- a/addons/sale_analytic_plans/sale_analytic_plans.py
+++ /dev/null
@@ -1,20 +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_order_line(osv.osv):
-    _inherit = 'sale.order.line'
-    _columns = {
-        'analytics_id': fields.many2one('account.analytic.plan.instance', 'Analytic Distribution'),
-    }
-    def invoice_line_create(self, cr, uid, ids, context=None):
-        if context is None:
-            context = {}
-        line_obj = self.pool.get('account.invoice.line')
-        create_ids = super(sale_order_line, self).invoice_line_create(cr, uid, ids, context=context)
-        i = 0
-        for line in self.browse(cr, uid, ids, context=context):
-            line_obj.write(cr, uid, [create_ids[i]], {'analytics_id': line.analytics_id.id})
-            i = i + 1
-        return create_ids
diff --git a/addons/sale_analytic_plans/sale_analytic_plans_view.xml b/addons/sale_analytic_plans/sale_analytic_plans_view.xml
deleted file mode 100644
index ba5b908c8ec5..000000000000
--- a/addons/sale_analytic_plans/sale_analytic_plans_view.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-  <data>
-
-    <record model="ir.ui.view" id="view_order_form_inherit2">
-        <field name="name">sale.order.form.inherit2</field>
-        <field name="model">sale.order</field>
-        <field name="inherit_id" ref="sale.view_order_form"/>
-        <field name="arch" type="xml">
-           <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']" position="after">
-               <field name="analytics_id" domain="[('plan_id','&lt;&gt;',False)]" groups="analytic.group_analytic_accounting"/>
-           </xpath>
-        </field>
-    </record>
-
-    <!-- the presence of 'analytics_id' makes the order lines non-editable -->
-    <record id="sale.view_order_form_editable_list" model="ir.ui.view">
-        <field name="groups_id" eval="[(4, ref('analytic.group_analytic_accounting'))]"/>
-    </record>
-
-    <record model="ir.ui.view" id="view_order_line_form2_inherit">
-        <field name="name">sale.order.line.form2.inherit</field>
-        <field name="model">sale.order.line</field>
-        <field name="inherit_id" ref="sale.view_order_line_form2"/>
-        <field name="arch" type="xml">
-            <field name="product_id" position="after">
-                <field name="analytics_id" domain="[('plan_id','&lt;&gt;',False)]" groups="analytic.group_analytic_accounting"/>
-            </field>
-        </field>
-    </record>
-
-
-    <!-- Replace analytic_id with analytics_id in account.invoice.line -->
-
-    <record model="ir.ui.view" id="view_invoice_line_form_inherit">
-        <field name="name">account.invoice.line.form.inherit</field>
-        <field name="model">account.invoice.line</field>
-        <field name="inherit_id" ref="account.view_invoice_line_form"/>
-        <field name="arch" type="xml">
-            <field name="account_analytic_id" position="replace">
-                <field name="analytics_id" context="{'journal_id':parent.journal_id}" domain="[('plan_id','&lt;&gt;',False)]" groups="analytic.group_analytic_accounting"/>
-            </field>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_invoice_form_analytic_inherit">
-        <field name="name">account.invoice.form.analytic.inherit</field>
-        <field name="model">account.invoice</field>
-        <field name="inherit_id" ref="account.invoice_form"/>
-        <field name="arch" type="xml">
-            <field name="account_analytic_id" position="replace">
-                <field name="analytics_id" context="{'journal_id':parent.journal_id}" domain="[('plan_id','&lt;&gt;',False)]" groups="analytic.group_analytic_accounting"/>
-            </field>
-        </field>
-    </record>
-
-
-  </data>
-</openerp>
-- 
GitLab