clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00089
lp:~juan-munoz-clearcorp/openerp-ccorp-addons/base_partner_code into lp:openerp-ccorp-addons/6.1
Juan Felipe Muñoz Ramos has proposed merging lp:~juan-munoz-clearcorp/openerp-ccorp-addons/base_partner_code into lp:openerp-ccorp-addons/6.1.
Requested reviews:
CLEARCORP development team (clearcorp)
For more details, see:
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/base_partner_code/+merge/99377
Changes:
Add module base_partner_code: adds field internal code to partner object
Fix base_company_prefix: change location of field prefix in view
Fix account_account_rename: add validation when prefix is False or null
--
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/base_partner_code/+merge/99377
Your team CLEARCORP development team is requested to review the proposed merge of lp:~juan-munoz-clearcorp/openerp-ccorp-addons/base_partner_code into lp:openerp-ccorp-addons/6.1.
=== modified file 'account_account_rename/account_rename.py'
--- account_account_rename/account_rename.py 2012-03-22 20:27:18 +0000
+++ account_account_rename/account_rename.py 2012-03-26 17:17:17 +0000
@@ -46,12 +46,15 @@
for obj_account in self.browse(cr,uid,ids):
obj_company = self.pool.get('res.company').browse(cr,uid,obj_account.company_id.id)
prefix= obj_company.prefix
+ if prefix == False:
+ prefix = ''
data = []
account = obj_account.parent_id
if account.parent_id:
while account.parent_id:
- data.insert(0,(account.shortcut or account.name))
- account = account.parent_id
+ if account.parent_id != None:
+ data.insert(0,(account.shortcut or account.name))
+ account = account.parent_id
data.append(obj_account.name)
data = '/'.join(data)
data = prefix + '-' + obj_account.code + ' ' + data
=== modified file 'base_company_prefix/base_company_prefix.xml'
--- base_company_prefix/base_company_prefix.xml 2012-03-22 20:27:18 +0000
+++ base_company_prefix/base_company_prefix.xml 2012-03-26 17:17:17 +0000
@@ -7,10 +7,13 @@
<field name="inherit_id" ref="base.view_company_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Company">
-
- <field name="prefix"/>
- </form>
+
+ <data>
+ <field name="name" position="after" >
+ <field name="prefix"/>
+ </field>
+ </data>
+
</field>
</record>
@@ -22,11 +25,13 @@
<field name="inherit_id" ref="base.view_company_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
- <tree>
-
- <field name="prefix"/>
-
- </tree>
+
+ <data>
+ <field name="name" position="after" >
+ <field name="prefix"/>
+ </field>
+ </data>
+
</field>
</record>
=== added directory 'base_partner_code'
=== added file 'base_partner_code/__init__.py'
--- base_partner_code/__init__.py 1970-01-01 00:00:00 +0000
+++ base_partner_code/__init__.py 2012-03-26 17:17:17 +0000
@@ -0,0 +1,35 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# __init__.py
+# account_journal_extended_code
+# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
+# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of ClearCorp S.A..
+#
+##############################################################################
+
+import base_partner_code
=== added file 'base_partner_code/__openerp__.py'
--- base_partner_code/__openerp__.py 1970-01-01 00:00:00 +0000
+++ base_partner_code/__openerp__.py 2012-03-26 17:17:17 +0000
@@ -0,0 +1,50 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# __openerp__.py
+# account_journal_extended_code
+# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
+# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of ClearCorp S.A..
+#
+##############################################################################
+
+{
+ 'name': 'Base Partner Code',
+ 'version': '0.1',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'General Modules/Base',
+ 'description': """Enables up to 64 chars in a journal code
+ """,
+ 'depends': ['base'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': ['base_partner_code_view.xml'],
+ 'license': 'Other OSI approved licence',
+ 'installable': True,
+ 'active': False,
+}
=== added file 'base_partner_code/base_partner_code.py'
--- base_partner_code/base_partner_code.py 1970-01-01 00:00:00 +0000
+++ base_partner_code/base_partner_code.py 2012-03-26 17:17:17 +0000
@@ -0,0 +1,17 @@
+
+from osv import osv,fields
+
+class res_partner(osv.osv):
+
+
+
+
+
+ _description='Partner'
+ _name = "res.partner"
+ _inherit = "res.partner"
+ _order = "name"
+ _columns = {
+ 'code': fields.char('Internal Code', size=16, select=1),
+ }
+res_partner()
=== added file 'base_partner_code/base_partner_code_view.xml'
--- base_partner_code/base_partner_code_view.xml 1970-01-01 00:00:00 +0000
+++ base_partner_code/base_partner_code_view.xml 2012-03-26 17:17:17 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+<record id="view_base_partner_code_tree" model="ir.ui.view">
+ <field name="name">res.partner.tree</field>
+ <field name="model">res.partner</field>
+ <field name="type">tree</field>
+ <!--field eval="8" name="priority"/-->
+ <field name="inherit_id" ref="base.view_partner_tree"/>
+ <field name="arch" type="xml">
+ <data>
+
+ <field name="name" position="after" >
+ <field name="code"/>
+ </field>
+
+ </data>
+ </field>
+ </record>
+
+
+ <record id="view_base_partner_code_form" model="ir.ui.view">
+ <field name="name">res.partner.form</field>
+ <field name="model">res.partner</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="base.view_partner_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="name" position='after'>
+ <field name="code"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+
+
+
+
+
+
+
+
+ </data>
+</openerp>
Follow ups