[IMP] rename sequence into ir_sequence
authorAntony Lesuisse <al@openerp.com>
Sat, 1 Oct 2011 00:04:55 +0000 (02:04 +0200)
committerAntony Lesuisse <al@openerp.com>
Sat, 1 Oct 2011 00:04:55 +0000 (02:04 +0200)
bzr revid: al@openerp.com-20111001000455-opnivkh5nvvutv2y

addons/account/__init__.py
addons/account/__openerp__.py
addons/account/ir_sequence.py [new file with mode: 0644]
addons/account/ir_sequence_view.xml [new file with mode: 0644]
addons/account/sequence.py [deleted file]
addons/account/sequence_view.xml [deleted file]

index 52c65f0..1b64386 100644 (file)
@@ -32,7 +32,7 @@ import account_analytic_line
 import wizard
 import report
 import product
-import sequence
+import ir_sequence
 import company
 import res_currency
 
index d1726d1..0a75b52 100644 (file)
@@ -119,7 +119,7 @@ module named account_voucher.
         'process/statement_process.xml',
         'process/customer_invoice_process.xml',
         'process/supplier_invoice_process.xml',
-        'sequence_view.xml',
+        'ir_sequence_view.xml',
         'company_view.xml',
         'board_account_view.xml',
         "wizard/account_report_profit_loss_view.xml",
diff --git a/addons/account/ir_sequence.py b/addons/account/ir_sequence.py
new file mode 100644 (file)
index 0000000..5c9039e
--- /dev/null
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class ir_sequence_fiscalyear(osv.osv):
+    _name = 'account.sequence.fiscalyear'
+    _rec_name = "sequence_main_id"
+    _columns = {
+        "sequence_id": fields.many2one("ir.sequence", 'Sequence', required=True,
+            ondelete='cascade'),
+        "sequence_main_id": fields.many2one("ir.sequence", 'Main Sequence',
+            required=True, ondelete='cascade'),
+        "fiscalyear_id": fields.many2one('account.fiscalyear', 'Fiscal Year',
+            required=True, ondelete='cascade')
+    }
+
+    _sql_constraints = [
+        ('main_id', 'CHECK (sequence_main_id != sequence_id)',
+            'Main Sequence must be different from current !'),
+    ]
+
+ir_sequence_fiscalyear()
+
+class ir_sequence(osv.osv):
+    _inherit = 'ir.sequence'
+    _columns = {
+        'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
+            'sequence_main_id', 'Sequences')
+    }
+
+    def _next(self, cr, uid, seq_ids, context=None):
+        for seq in self.browse(cr, uid, seq_ids, context):
+            for line in seq.fiscal_ids:
+                if line.fiscalyear_id.id == context.get('fiscalyear_id'):
+                    return super(ir_sequence, self)._next(cr, uid, [line.sequence_id.id], context)
+        return super(ir_sequence, self)._next(cr, uid, seq_ids, context)
+
+ir_sequence()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/ir_sequence_view.xml b/addons/account/ir_sequence_view.xml
new file mode 100644 (file)
index 0000000..fe34590
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="sequence_inherit_form" model="ir.ui.view">
+            <field name="name">ir.sequence.form</field>
+            <field name="model">ir.sequence</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="base.sequence_view"/>
+            <field name="arch" type="xml">
+                <page position="after">
+                    <page string="Fiscal Years" groups="base.group_extended">
+                        <field name="fiscal_ids" nolabel="1" colspan="4">
+                            <tree string="Fiscal Year Sequences" editable="bottom">
+                                <field name="fiscalyear_id"/>
+                                <field name="sequence_id" domain="[('code','=',parent.code)]"/>
+                            </tree>
+                            <form string="Fiscal Year Sequence">
+                                <field name="fiscalyear_id"/>
+                                <field name="sequence_id" domain="[('code','=',parent.code)]"/>
+                            </form>
+                        </field>
+                    </page>
+                </page>
+            </field>
+        </record>
+
+    </data>
+</openerp>
diff --git a/addons/account/sequence.py b/addons/account/sequence.py
deleted file mode 100644 (file)
index 5c9039e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-#    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 <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from osv import fields, osv
-
-class ir_sequence_fiscalyear(osv.osv):
-    _name = 'account.sequence.fiscalyear'
-    _rec_name = "sequence_main_id"
-    _columns = {
-        "sequence_id": fields.many2one("ir.sequence", 'Sequence', required=True,
-            ondelete='cascade'),
-        "sequence_main_id": fields.many2one("ir.sequence", 'Main Sequence',
-            required=True, ondelete='cascade'),
-        "fiscalyear_id": fields.many2one('account.fiscalyear', 'Fiscal Year',
-            required=True, ondelete='cascade')
-    }
-
-    _sql_constraints = [
-        ('main_id', 'CHECK (sequence_main_id != sequence_id)',
-            'Main Sequence must be different from current !'),
-    ]
-
-ir_sequence_fiscalyear()
-
-class ir_sequence(osv.osv):
-    _inherit = 'ir.sequence'
-    _columns = {
-        'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
-            'sequence_main_id', 'Sequences')
-    }
-
-    def _next(self, cr, uid, seq_ids, context=None):
-        for seq in self.browse(cr, uid, seq_ids, context):
-            for line in seq.fiscal_ids:
-                if line.fiscalyear_id.id == context.get('fiscalyear_id'):
-                    return super(ir_sequence, self)._next(cr, uid, [line.sequence_id.id], context)
-        return super(ir_sequence, self)._next(cr, uid, seq_ids, context)
-
-ir_sequence()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/sequence_view.xml b/addons/account/sequence_view.xml
deleted file mode 100644 (file)
index fe34590..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record id="sequence_inherit_form" model="ir.ui.view">
-            <field name="name">ir.sequence.form</field>
-            <field name="model">ir.sequence</field>
-            <field name="type">form</field>
-            <field name="inherit_id" ref="base.sequence_view"/>
-            <field name="arch" type="xml">
-                <page position="after">
-                    <page string="Fiscal Years" groups="base.group_extended">
-                        <field name="fiscal_ids" nolabel="1" colspan="4">
-                            <tree string="Fiscal Year Sequences" editable="bottom">
-                                <field name="fiscalyear_id"/>
-                                <field name="sequence_id" domain="[('code','=',parent.code)]"/>
-                            </tree>
-                            <form string="Fiscal Year Sequence">
-                                <field name="fiscalyear_id"/>
-                                <field name="sequence_id" domain="[('code','=',parent.code)]"/>
-                            </form>
-                        </field>
-                    </page>
-                </page>
-            </field>
-        </record>
-
-    </data>
-</openerp>