diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 5ef80d40560..b15b4e94ad6 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -863,7 +863,6 @@ class account_invoice(osv.osv): # make the invoice point to that move self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}) self.pool.get('account.move').post(cr, uid, [move_id]) - self._log_event(cr, uid, ids) return True def line_get_convert(self, cr, uid, x, part, date, context=None): @@ -917,6 +916,7 @@ class account_invoice(osv.osv): 'WHERE account_move_line.move_id = %s ' \ 'AND account_analytic_line.move_id = account_move_line.id', (ref, move_id)) + self._log_event(cr, uid, ids) return True def action_cancel(self, cr, uid, ids, *args): @@ -952,7 +952,17 @@ class account_invoice(osv.osv): return taxes.values() def _log_event(self, cr, uid, ids, factor=1.0, name='Open Invoice'): - #TODO: implement messages system + for (invoice_id,number) in self.name_get(cr, uid, ids): + invoice = self.browse(cr,uid,invoice_id) + message = ("%s %s %s %s %s %s %s") % ( + _('Invoice'), + _("INV/"), + number.split('/')[-1], + _("Opened,"), + _('journal entries'), + invoice.move_id.name, + _("Created")) + self.log(cr, uid, invoice_id, message) return True def name_get(self, cr, uid, ids, context=None): diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py index c3934e38db0..3b63ed843d1 100644 --- a/addons/account/wizard/account_invoice_state.py +++ b/addons/account/wizard/account_invoice_state.py @@ -37,11 +37,11 @@ class account_invoice_confirm(osv.osv_memory): context = {} pool_obj = pooler.get_pool(cr.dbname) data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) - + for record in data_inv: if record['state'] not in ('draft','proforma','proforma2'): raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!")) - wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr) + wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_open', cr) return {} account_invoice_confirm() @@ -61,7 +61,7 @@ class account_invoice_cancel(osv.osv_memory): wf_service = netsvc.LocalService('workflow') pool_obj = pooler.get_pool(cr.dbname) data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) - + for record in data_inv: if record['state'] in ('cancel','paid'): raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state!")) diff --git a/addons/base_module_quality/pep8_test/pep8_test.py b/addons/base_module_quality/pep8_test/pep8_test.py index 52c04756382..4aaaaa7bddc 100644 --- a/addons/base_module_quality/pep8_test/pep8_test.py +++ b/addons/base_module_quality/pep8_test/pep8_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -48,7 +48,7 @@ PEP-8 Test , copyright of py files check, method can not call from loops list_files.append(os.path.join(i, j)) py_list = [] for file_py in list_files: - if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): + if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__openerp__.py'): file_path = os.path.join(module_path, file_py) py_list.append(file_path) diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index 8dbbce0e2ce..12400dbb196 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -50,7 +50,7 @@ class quality_test(base_module_quality.abstract_quality_check): flag = False self.result_details += '''%s'''%(self.get_style()) for file_py in list_files: - if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): + if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__openerp__.py'): if not flag: flag = True file_path = os.path.join(module_path, file_py) diff --git a/addons/base_module_quality/structure_test/structure_test.py b/addons/base_module_quality/structure_test/structure_test.py index 466976f5d17..10b80aaacdd 100644 --- a/addons/base_module_quality/structure_test/structure_test.py +++ b/addons/base_module_quality/structure_test/structure_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -82,7 +82,7 @@ This test checks if the module satisfy tiny structure # module files calculation (module.py,module_view.xml,etc..) com_list = ['_unit_test.xml', '.py', '_view.xml', '_workflow.xml' , '_wizard.xml', '_report.xml', '_data.xml', '_demo.xml', '_security.xml', '_sequence.xml', '_graph.xml'] com_list = map(lambda x: module_name + x, com_list) - main_file = ['__init__.py', '__terp__.py'] + main_file = ['__init__.py', '__openerp__.py'] com_list.extend(main_file) module_dict['module'] = filter(lambda x: len(x.split(".")) > 1, module_dict['module']) score = self.get_score(module_dict['module'], com_list) diff --git a/addons/base_module_quality/terp_test/terp_test.py b/addons/base_module_quality/terp_test/terp_test.py index 993a80fe32b..a9747496dc1 100644 --- a/addons/base_module_quality/terp_test/terp_test.py +++ b/addons/base_module_quality/terp_test/terp_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -49,13 +49,13 @@ class quality_test(base_module_quality.abstract_quality_check): score = 1.0 feel_good_factor = 0 feel_bad_factor = 0 - if '__terp__.py' not in list_files: + if '__openerp__.py' not in list_files: self.no_terp = True - self.result += _("The module does not contain the __terp__.py file") + self.result += _("The module does not contain the __openerp__.py file") return None result_dict = {} result_dict1 = {} - terp_file = os.path.join(module_path,'__terp__.py') + terp_file = os.path.join(module_path,'__openerp__.py') res = eval(tools.file_open(terp_file).read()) terp_keys = ['category', 'name', 'description', 'author', 'website', 'update_xml', 'init_xml', 'depends', 'version', 'active', 'installable', 'demo_xml'] for key in terp_keys: @@ -117,7 +117,7 @@ class quality_test(base_module_quality.abstract_quality_check): self.result_details += self.get_result_details(result_dict) self.result_details += self.get_result_details(result_dict1) - return [_('__terp__.py file'), score] + return [_('__openerp__.pyfile'), score] def run_test(self, cr, uid, module_path): terp_score = self.run_test_terp(cr, uid, module_path) @@ -125,7 +125,7 @@ class quality_test(base_module_quality.abstract_quality_check): if self.score*100 < self.min_score: self.message = 'Score is below than minimal score(%s%%)' % self.min_score if terp_score: - self.result = self.get_result({'__terp__.py': terp_score}) + self.result = self.get_result({'__openerp__.py': terp_score}) return None def get_result(self, dict_terp): diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index db15ef3bf93..1dc0cd5a561 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -264,6 +264,8 @@ + + diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 685d289a194..488132a8b78 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -20,6 +20,7 @@ ############################################################################## from mx import DateTime +from datetime import datetime, timedelta from osv import fields from osv import osv from tools.translate import _ @@ -117,9 +118,9 @@ class mrp_bom(osv.osv): """ Defines bills of material for a product. """ - _name = 'mrp.bom' + _name = 'mrp.bom' _description = 'Bill of Material' - + def _child_compute(self, cr, uid, ids, name, arg, context={}): """ Gets child bom. @param self: The object pointer @@ -419,7 +420,6 @@ class mrp_production(osv.osv): _name = 'mrp.production' _description = 'Manufacturing Order' _date_name = 'date_planned' - _log_create = True def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}): """ Calculates total hours and total no. of cycles for a production order. @@ -647,15 +647,23 @@ class mrp_production(osv.osv): """ Changes the production state to Ready and location id of stock move. @return: True """ - for (id,name) in self.name_get(cr, uid, ids): - message = _('Manufacturing Order ') + " '" + name + "' "+ _("is ready to produce.") - self.log(cr, uid, id, message) move_obj = self.pool.get('stock.move') self.write(cr, uid, ids, {'state': 'ready'}) - for production in self.browse(cr, uid, ids): + + for (production_id,name) in self.name_get(cr, uid, ids): + production = self.browse(cr, uid, production_id) if production.move_prod_id: move_obj.write(cr, uid, [production.move_prod_id.id], {'location_id': production.location_dest_id.id}) + + message = ("%s %s %s %s %s %s") % ( + _('Manufacturing Order '), + name, + _("scheduled the"), + datetime.strptime(production.date_planned,'%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d'), + _("for"), + production.product_id.default_code) + self.log(cr, uid, production_id, message) return True def action_production_end(self, cr, uid, ids):