Amit Patel
2012-09-28 10:35:41 +05:30
12 changed files with 23 additions and 42 deletions
-1
View File
@@ -98,7 +98,6 @@ The kernel of OpenERP, needed for all installation.
],
'installable': True,
'auto_install': True,
'certificate': '0076807797149',
'css': ['static/src/css/modules.css'],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-1
View File
@@ -294,7 +294,6 @@ CREATE TABLE ir_module_module (
shortdesc character varying(256),
complexity character varying(32),
category_id integer REFERENCES ir_module_category ON DELETE SET NULL,
certificate character varying(64),
description text,
application boolean default False,
demo boolean default False,
+1
View File
@@ -8,6 +8,7 @@
<field name="symbol">$</field>
<field name="rounding">0.01</field>
<field name="accuracy">4</field>
<field name="position">before</field>
<field name="company_id" ref="main_company"/>
</record>
<record id="rateUSD" model="res.currency.rate">
-13
View File
@@ -237,7 +237,6 @@ class module(osv.osv):
'menus_by_module': fields.function(_get_views, string='Menus', type='text', multi="meta", store=True),
'reports_by_module': fields.function(_get_views, string='Reports', type='text', multi="meta", store=True),
'views_by_module': fields.function(_get_views, string='Views', type='text', multi="meta", store=True),
'certificate' : fields.char('Quality Certificate', size=64, readonly=True),
'application': fields.boolean('Application', readonly=True),
'icon': fields.char('Icon URL', size=128),
'icon_image': fields.function(_get_icon_image, string='Icon', type="binary"),
@@ -253,12 +252,9 @@ class module(osv.osv):
def _name_uniq_msg(self, cr, uid, ids, context=None):
return _('The name of the module must be unique !')
def _certificate_uniq_msg(self, cr, uid, ids, context=None):
return _('The certificate ID of the module must be unique !')
_sql_constraints = [
('name_uniq', 'UNIQUE (name)',_name_uniq_msg ),
('certificate_uniq', 'UNIQUE (certificate)',_certificate_uniq_msg )
]
def unlink(self, cr, uid, ids, context=None):
@@ -511,7 +507,6 @@ class module(osv.osv):
'contributors': ', '.join(terp.get('contributors', [])) or False,
'website': terp.get('website', ''),
'license': terp.get('license', 'AGPL-3'),
'certificate': terp.get('certificate') or False,
'sequence': terp.get('sequence', 100),
'application': terp.get('application', False),
'auto_install': terp.get('auto_install', False),
@@ -677,14 +672,6 @@ class module(osv.osv):
if not mod.description:
_logger.warning('module %s: description is empty !', mod.name)
if not mod.certificate or not mod.certificate.isdigit():
_logger.info('module %s: no quality certificate', mod.name)
else:
val = long(mod.certificate[2:]) % 97 == 29
if not val:
_logger.critical('module %s: invalid quality certificate: %s', mod.name, mod.certificate)
raise osv.except_osv(_('Error'), _('Module %s: Invalid Quality Certificate') % (mod.name,))
class module_dependency(osv.osv):
_name = "ir.module.module.dependency"
_description = "Module dependency"
+5 -5
View File
@@ -25,25 +25,25 @@
</record>
<record model="ir.module.category" id="module_category_sales_management">
<field name="name">Sales Management</field>
<field name="name">Sales</field>
<field name="description">Helps you handle your quotations, sale orders and invoicing.</field>
<field name="sequence">2</field>
</record>
<record model="ir.module.category" id="module_category_project_management">
<field name="name">Project Management</field>
<field name="name">Project</field>
<field name="description">Helps you manage your projects and tasks by tracking them, generating plannings, etc...</field>
<field name="sequence">3</field>
</record>
<record model="ir.module.category" id="module_category_knowledge_management">
<field name="name">Knowledge Management</field>
<field name="name">Knowledge</field>
<field name="description">Lets you install addons geared towards sharing knowledge with and between your employees.</field>
<field name="sequence">4</field>
</record>
<record model="ir.module.category" id="module_category_warehouse_management">
<field name="name">Warehouse Management</field>
<field name="name">Warehouse</field>
<field name="description">Helps you manage your inventory and main stock operations: delivery orders, receptions, etc.</field>
<field name="sequence">5</field>
</record>
@@ -67,7 +67,7 @@
</record>
<record model="ir.module.category" id="module_category_purchase_management">
<field name="name">Purchase Management</field>
<field name="name">Purchases</field>
<field name="description">Helps you manage your purchase-related processes such as requests for quotations, supplier invoices, etc...</field>
<field name="sequence">9</field>
</record>
+6 -2
View File
@@ -199,7 +199,10 @@ class res_partner(osv.osv, format_address):
'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'),
'website': fields.char('Website', size=64, help="Website of Partner or Company"),
'comment': fields.text('Notes'),
'address': fields.one2many('res.partner.address', 'partner_id', 'Contacts'), # should be removed in version 7, but kept until then for backward compatibility
'address': fields.one2many('res.partner.address', 'partner_id', 'Addresses',
deprecated="The address information is now directly stored on each Partner record. "\
"Multiple contacts with their own address can be added via the child_ids relationship. "\
"This field will be removed as of OpenERP 7.1."),
'category_id': fields.many2many('res.partner.category', id1='partner_id', id2='category_id', string='Tags'),
'credit_limit': fields.float(string='Credit Limit'),
'ean13': fields.char('EAN13', size=13),
@@ -218,7 +221,8 @@ class res_partner(osv.osv, format_address):
'city': fields.char('City', size=128),
'state_id': fields.many2one("res.country.state", 'State'),
'country_id': fields.many2one('res.country', 'Country'),
'country': fields.related('country_id', type='many2one', relation='res.country', string='Country'), # for backward compatibility
'country': fields.related('country_id', type='many2one', relation='res.country', string='Country',
deprecated="This field will be removed as of OpenERP 7.1, use country_id instead"),
'email': fields.char('Email', size=240),
'phone': fields.char('Phone', size=64),
'fax': fields.char('Fax', size=64),
+1 -1
View File
@@ -247,7 +247,7 @@
</field>
</page>
<page string="Internal Notes">
<field name="comment" placeholder="Internal notes about this customer..."/>
<field name="comment" placeholder="Put an internal note..."/>
</page>
<page string="Sales &amp; Purchases">
<group>
@@ -11,7 +11,7 @@
<field name="name">Access Rights</field>
</record>
<record model="res.groups" id="group_system">
<field name="name">Configuration</field>
<field name="name">Settings</field>
<field name="implied_ids" eval="[(4, ref('group_erp_manager'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
+3 -3
View File
@@ -74,12 +74,12 @@ def initialize(cr):
cr.execute('INSERT INTO ir_module_module \
(author, website, name, shortdesc, description, \
category_id, auto_install, state, certificate, web, license, application, icon, sequence, summary) \
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
category_id, auto_install, state, web, license, application, icon, sequence, summary) \
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
info['author'],
info['website'], i, info['name'],
info['description'], category_id,
info['auto_install'], state, info['certificate'],
info['auto_install'], state,
info['web'],
info['license'],
info['application'], info['icon'],
+1 -1
View File
@@ -61,7 +61,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
:param graph: graph of module nodes to load
:param status: status dictionary for keeping track of progress
:param perform_checks: whether module descriptors should be checked for validity (prints warnings
for same cases, and even raise osv_except if certificate is invalid)
for same cases)
:param skip_modules: optional list of module names (packages) which have previously been loaded and can be skipped
:return: list of modules that were installed or updated
"""
-1
View File
@@ -331,7 +331,6 @@ def load_information_from_description_file(module):
'author': '',
'auto_install': False,
'category': 'Uncategorized',
'certificate': None,
'depends': [],
'description': '',
'icon': get_module_icon(module),
+5 -13
View File
@@ -1552,24 +1552,16 @@ def field_to_dict(model, cr, user, field, context=None):
res['fnct_search'] = field._fnct_search and field._fnct_search.func_name or False
res['fnct_inv'] = field._fnct_inv and field._fnct_inv.func_name or False
res['fnct_inv_arg'] = field._fnct_inv_arg or False
res['func_obj'] = field._obj or False
if isinstance(field, many2many):
(table, col1, col2) = field._sql_names(model)
res['related_columns'] = [col1, col2]
res['third_table'] = table
for arg in ('string', 'readonly', 'states', 'size', 'required', 'group_operator',
'change_default', 'translate', 'help', 'select', 'selectable', 'groups'):
if getattr(field, arg):
res[arg] = getattr(field, arg)
for arg in ('digits', 'invisible', 'filters'):
res['m2m_join_columns'] = [col1, col2]
res['m2m_join_table'] = table
for arg in ('string', 'readonly', 'states', 'size', 'group_operator', 'required',
'change_default', 'translate', 'help', 'select', 'selectable', 'groups',
'deprecated', 'digits', 'invisible', 'filters'):
if getattr(field, arg, None):
res[arg] = getattr(field, arg)
if field.string:
res['string'] = field.string
if field.help:
res['help'] = field.help
if hasattr(field, 'selection'):
if isinstance(field.selection, (tuple, list)):
res['selection'] = field.selection