clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00426
[Merge] lp:~wg.clearcorp/openerp-ccorp-addons/6.1-sequences into lp:openerp-ccorp-addons
Willy Andres Gomez Solorzano has proposed merging lp:~wg.clearcorp/openerp-ccorp-addons/6.1-sequences into lp:openerp-ccorp-addons.
Requested reviews:
Ronald Rubi (rr.clearcorp)
For more details, see:
https://code.launchpad.net/~wg.clearcorp/openerp-ccorp-addons/6.1-sequences/+merge/138755
Modified sequence behaviour in sale orders, purchase orders and production orders. Fixes sequentiation in case that the order is not saved.
--
https://code.launchpad.net/~wg.clearcorp/openerp-ccorp-addons/6.1-sequences/+merge/138755
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons.
=== added directory 'mrp_production_sequence'
=== added file 'mrp_production_sequence/__init__.py'
--- mrp_production_sequence/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_production_sequence/__init__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+import mrp_production_sequence
=== added file 'mrp_production_sequence/__openerp__.py'
--- mrp_production_sequence/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_production_sequence/__openerp__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+{
+ 'name': 'MRP production Sequence',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'mrp',
+ 'complexity': 'easy',
+ 'description': """This module modifies sequence behaviour, generating the sequence number in the create method, to avoid non-consecutive numbers.
+ """,
+ 'depends': [
+ 'mrp',
+ ],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': ['mrp_production_sequence.xml'],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
=== added file 'mrp_production_sequence/mrp_production_sequence.py'
--- mrp_production_sequence/mrp_production_sequence.py 1970-01-01 00:00:00 +0000
+++ mrp_production_sequence/mrp_production_sequence.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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 ccorp_mrp_production(osv.osv):
+ _inherit = 'mrp.production'
+
+ _columns ={
+ 'name': fields.char('Reference', size=64,),
+ }
+ _defaults = {
+ 'name': '',
+ }
+
+ def create(self, cr, uid, vals, context=None):
+ if not 'name' in vals:
+ sequence = self.pool.get('ir.sequence').get(cr, uid, 'mrp.production', context=context) or '/'
+ vals['name'] = sequence
+ result = super(ccorp_mrp_production, self).create(cr, uid, vals, context=context)
+ return result
+
=== added file 'mrp_production_sequence/mrp_production_sequence.xml'
--- mrp_production_sequence/mrp_production_sequence.xml 1970-01-01 00:00:00 +0000
+++ mrp_production_sequence/mrp_production_sequence.xml 2012-12-07 15:35:25 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <record id="sequence_mrp_production_form_view" model="ir.ui.view">
+ <field name="name">sequence.mrp.production.form</field>
+ <field name="model">mrp.production</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="mrp.mrp_production_form_view"/>
+ <field name="arch" type="xml">
+ <field name="name" position="replace">
+ <field name="name" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
+
=== added directory 'purchase_order_sequence'
=== added file 'purchase_order_sequence/__init__.py'
--- purchase_order_sequence/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_sequence/__init__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+import purchase_order_sequence
=== added file 'purchase_order_sequence/__openerp__.py'
--- purchase_order_sequence/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_sequence/__openerp__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+{
+ 'name': 'Purchase Order Sequence',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Purchase',
+ 'complexity': 'easy',
+ 'description': """This module modifies sequence behaviour, generating the sequence number in the create method, to avoid non-consecutive numbers.
+ """,
+ 'depends': [
+ 'purchase',
+ ],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': ['purchase_order_sequence.xml'],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
=== added file 'purchase_order_sequence/purchase_order_sequence.py'
--- purchase_order_sequence/purchase_order_sequence.py 1970-01-01 00:00:00 +0000
+++ purchase_order_sequence/purchase_order_sequence.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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 ccorp_purchase_order(osv.osv):
+ _inherit = 'purchase.order'
+
+ _columns ={
+ 'name': fields.char('Order Reference', size=64,
+ select=True, help="unique number of the purchase order,computed automatically when the purchase order is created"),
+ }
+ _defaults = {
+ 'name': '',
+ }
+
+ def create(self, cr, uid, vals, context=None):
+ if not 'name' in vals:
+ sequence = self.pool.get('ir.sequence').get(cr, uid, 'purchase.order', context=context) or '/'
+ vals['name'] = sequence
+ result = super(ccorp_purchase_order, self).create(cr, uid, vals, context=context)
+ return result
+
=== added file 'purchase_order_sequence/purchase_order_sequence.xml'
--- purchase_order_sequence/purchase_order_sequence.xml 1970-01-01 00:00:00 +0000
+++ purchase_order_sequence/purchase_order_sequence.xml 2012-12-07 15:35:25 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <record id="sequence_purchase_order_form" model="ir.ui.view">
+ <field name="name">sequence.purchase.order.form</field>
+ <field name="model">purchase.order</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="purchase.purchase_order_form"/>
+ <field name="arch" type="xml">
+ <field name="name" position="replace">
+ <field name="name" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
+
=== added directory 'sale_order_sequence'
=== added file 'sale_order_sequence/__init__.py'
--- sale_order_sequence/__init__.py 1970-01-01 00:00:00 +0000
+++ sale_order_sequence/__init__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+import sale_order_sequence
=== added file 'sale_order_sequence/__openerp__.py'
--- sale_order_sequence/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sale_order_sequence/__openerp__.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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/>.
+#
+##############################################################################
+{
+ 'name': 'Sale Order Sequence',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Sales',
+ 'complexity': 'easy',
+ 'description': """This module modifies sequence behaviour, generating the sequence number in the create method, to avoid non-consecutive numbers.
+ """,
+ 'depends': [
+ 'sale',
+ ],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': ['sale_order_sequence.xml'],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
=== added file 'sale_order_sequence/sale_order_sequence.py'
--- sale_order_sequence/sale_order_sequence.py 1970-01-01 00:00:00 +0000
+++ sale_order_sequence/sale_order_sequence.py 2012-12-07 15:35:25 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# 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 ccorp_sale_order(osv.osv):
+ _inherit = 'sale.order'
+
+ _columns ={
+ 'name': fields.char('Order Reference', size=64,
+ readonly=True, states={'draft': [('readonly', False)]}, select=True),
+ }
+ _defaults = {
+ 'name': '',
+ }
+
+ def create(self, cr, uid, vals, context=None):
+ if not 'name' in vals:
+ sequence = self.pool.get('ir.sequence').get(cr, uid, 'sale.order', context=context) or '/'
+ vals['name'] = sequence
+ result = super(ccorp_sale_order, self).create(cr, uid, vals, context=context)
+ return result
+
=== added file 'sale_order_sequence/sale_order_sequence.xml'
--- sale_order_sequence/sale_order_sequence.xml 1970-01-01 00:00:00 +0000
+++ sale_order_sequence/sale_order_sequence.xml 2012-12-07 15:35:25 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <record id="sequence_view_order_form" model="ir.ui.view">
+ <field name="name">sequence.view.order.form</field>
+ <field name="model">sale.order</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <field name="name" position="replace">
+ <field name="name" readonly="1"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
+
Follow ups