From f0b124d52dc24d9175dfa030b6c8608151b92479 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 11 Jun 2010 11:32:15 +0530 Subject: [PATCH 01/11] [Fix] Point_of_sale:Fix the name of rule group bzr revid: sbh@tinyerp.com-20100611060215-zdkvnoqf1t2epbof --- addons/point_of_sale/pos.py | 6 +++--- addons/point_of_sale/posrule_data.xml | 20 +++++++++++++------- addons/point_of_sale/statement_data.xml | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 5d4df5a5f10..0ec31cb88fe 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -193,7 +193,7 @@ class pos_order(osv.osv): res[order.id]['amount_tax']) else: res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2), - tax_obj.compute(cr, uid, line.product_id.taxes_id, + tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ (1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) @@ -789,7 +789,7 @@ class pos_order(osv.osv): tax_amount = 0 taxes = [t for t in line.product_id.taxes_id] if order.price_type=='tax_excluded': - computed_taxes = account_tax_obj.compute( + computed_taxes = account_tax_objcompute_all( cr, uid, taxes, line.price_unit, line.qty) else: computed_taxes = account_tax_obj.compute_inv( @@ -1058,7 +1058,7 @@ class pos_order_line(osv.osv): for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] - computed_taxes = account_tax_obj.compute(cr, uid, taxes, line.price_unit, line.qty) + computed_taxes = account_tax_objcompute_all(cr, uid, taxes, line.price_unit, line.qty) for tax in computed_taxes: tax_amount += tax['amount'] price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) diff --git a/addons/point_of_sale/posrule_data.xml b/addons/point_of_sale/posrule_data.xml index 905e78e6e7a..be1b3d0a802 100644 --- a/addons/point_of_sale/posrule_data.xml +++ b/addons/point_of_sale/posrule_data.xml @@ -2,6 +2,12 @@ + + point + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + @@ -63,12 +69,12 @@ - - - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + @@ -98,7 +104,7 @@ ref('procurement.menu_mrp_procurement_action3'), ref('point_of_sale.menu_point_root')])]" name="menu_access"/> - + diff --git a/addons/point_of_sale/statement_data.xml b/addons/point_of_sale/statement_data.xml index 5172e0e70d4..a1f920c5c43 100644 --- a/addons/point_of_sale/statement_data.xml +++ b/addons/point_of_sale/statement_data.xml @@ -34,7 +34,7 @@ - + From ca9b03d3211ca34dd280d5c9da78c25cad2d59e7 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 11 Jun 2010 18:16:55 +0530 Subject: [PATCH 02/11] [IMP] point_of_sale: chagned name of method and put the data file in comment bzr revid: sbh@tinyerp.com-20100611124655-n8ksbqwyk13gsr81 --- addons/point_of_sale/__openerp__.py | 6 +++--- addons/point_of_sale/pos.py | 11 ++++------- addons/point_of_sale/test/pos_test.yml | 9 +++++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 27707bcf0e0..b83834d0677 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -67,14 +67,14 @@ Main features : # 'pos_wizard.xml', 'pos_view.xml', 'pos_sequence.xml', - 'posrule_data.xml', + #'posrule_data.xml', 'pos_data.xml', 'pos_workflow.xml', 'statement_view.xml', 'statement_report.xml', - 'statement_data.xml', + #'statement_data.xml', ], - 'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'], + 'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',], 'test':['test/pos_test.yml',], 'installable': True, } diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 0ec31cb88fe..d31706e1b0e 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -192,11 +192,10 @@ class pos_order(osv.osv): (1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) else: - res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2), - tax_obj.compute_all(cr, uid, line.product_id.taxes_id, + res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ - (1-(line.discount or 0.0)/100.0), line.qty), - res[order.id]['amount_tax']) + (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] + return res @@ -1058,9 +1057,7 @@ class pos_order_line(osv.osv): for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] - computed_taxes = account_tax_objcompute_all(cr, uid, taxes, line.price_unit, line.qty) - for tax in computed_taxes: - tax_amount += tax['amount'] + tax_amount = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['total_included'] price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) if line.discount!=0.0: res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0) diff --git a/addons/point_of_sale/test/pos_test.yml b/addons/point_of_sale/test/pos_test.yml index a96a792c711..3019b49144d 100644 --- a/addons/point_of_sale/test/pos_test.yml +++ b/addons/point_of_sale/test/pos_test.yml @@ -119,7 +119,7 @@ I create Sales Account. - !record {model: account.account, id: account_account_sales0}: - code: S + code: Sale company_id: base.main_company currency_mode: current name: Sales @@ -473,4 +473,9 @@ self.action_confirm(cr, uid, [ref("pos_confirm_0")], {"lang": "en_US", "active_model": "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"), }) - +- + I check order state is done. +- + !python {model: pos.order}: | + order=self.browse(cr,uid,ref("pos_order_pos0")) + assert(order.state=='done'), "Order is not done" From dbf6ad6defdf70776a7e771d2b057a962eaf540c Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 11 Jun 2010 18:33:03 +0530 Subject: [PATCH 03/11] [IMP] point_of_sale: Improve the code bzr revid: sbh@tinyerp.com-20100611130303-hc0hjszkh3lecoxl --- addons/point_of_sale/pos.py | 60 ++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index d31706e1b0e..1e67f7872df 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -65,7 +65,7 @@ class pos_order(osv.osv): _order = "date_order desc" - def unlink(self, cr, uid, ids, context={}): + def unlink(self, cr, uid, ids, context=None): for rec in self.browse(cr, uid, ids, context=context): for rec_statement in rec.statement_ids: @@ -73,7 +73,7 @@ class pos_order(osv.osv): raise osv.except_osv(_('Invalid action !'), _('Cannot delete a point of sale which is closed or contains confirmed cashboxes!')) return super(pos_order, self).unlink(cr, uid, ids, context=context) - def onchange_partner_pricelist(self, cr, uid, ids, part, context={}): + def onchange_partner_pricelist(self, cr, uid, ids, part, context=None): """ Changed price list on_change of partner_id""" @@ -82,7 +82,7 @@ class pos_order(osv.osv): pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id return {'value':{'pricelist_id': pricelist}} - def _amount_total(self, cr, uid, ids, field_name, arg, context): + def _amount_total(self, cr, uid, ids, field_name, arg, context=None): """ Calculates amount_tax of order line @param field_names: Names of fields. @@ -224,7 +224,7 @@ class pos_order(osv.osv): return res[0] else: return False - def copy(self, cr, uid, id, default=None, context={}): + def copy(self, cr, uid, id, default=None, context=None): if not default: default = {} @@ -333,7 +333,7 @@ class pos_order(osv.osv): else: return False - def _journal_default(self, cr, uid, context={}): + def _journal_default(self, cr, uid, context=None): """ To get default pricelist for the order" @param name: Names of fields. @@ -364,7 +364,7 @@ class pos_order(osv.osv): } - def test_order_lines(self, cr, uid, order, context={}): + def test_order_lines(self, cr, uid, order, context=None): """ Test order line is created or not for the order " @param name: Names of fields. @@ -377,7 +377,7 @@ class pos_order(osv.osv): wf_service.trg_validate(uid, 'pos.order', order.id, 'paid', cr) return True - def dummy_button(self, cr, uid, order, context={}): + def dummy_button(self, cr, uid, order, context=None): return True def test_paid(self, cr, uid, ids, context=None): @@ -457,11 +457,13 @@ class pos_order(osv.osv): # delete it in the new picking: line.unlink(context=context) - def create_picking(self, cr, uid, ids, context={}): + def create_picking(self, cr, uid, ids, context=None): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking') + property_obj=self.pool.get("ir.property") + move_obj=self.pool.get('stock.move') pick_name=self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') orders = self.browse(cr, uid, ids, context) for order in orders: @@ -494,8 +496,8 @@ class pos_order(osv.osv): for line in order.lines: if line.product_id and line.product_id.type=='service': continue - prop_ids = self.pool.get("ir.property").search(cr, uid, [('name', '=', 'property_stock_customer')]) - val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value_reference + prop_ids = property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')]) + val = property_obj.browse(cr, uid, prop_ids[0]).value_reference cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order.shop_id.warehouse_id.id)) res=cr.fetchone() location_id=res and res[0] or None @@ -504,7 +506,7 @@ class pos_order(osv.osv): if line.qty < 0: location_id, stock_dest_id = stock_dest_id, location_id - self.pool.get('stock.move').create(cr, uid, { + move_obj.create(cr, uid, { 'name': 'Stock move (POS %d)' % (order.id, ), 'product_uom': line.product_id.uom_id.id, 'product_uos': line.product_id.uom_id.id, @@ -582,7 +584,7 @@ class pos_order(osv.osv): @return: True """ self.write(cr, uid, ids, {'state': 'cancel'}) - self.cancel_picking(cr, uid, ids, context={}) + self.cancel_picking(cr, uid, ids, context=None) return True def add_payment(self, cr, uid, order_id, data, context=None): @@ -590,8 +592,10 @@ class pos_order(osv.osv): """Create a new payment for the order""" res_obj = self.pool.get('res.company') + statement_obj= self.pool.get('account.bank.statement') statementl_obj = self.pool.get('account.bank.statement.line') prod_obj = self.pool.get('product.product') + property_obj=self.pool.get('ir.property') flag='' curr_c=self.pool.get('res.users').browse(cr, uid, uid).company_id curr_company=curr_c.id @@ -608,7 +612,7 @@ class pos_order(osv.osv): args['date'] = data['payment_date'] if 'payment_name' in data.keys(): args['name'] = data['payment_name'] + ' ' +order.name - account_def = self.pool.get('ir.property').get(cr, uid, 'property_account_receivable', 'res.partner', context=context) + account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id if data.get('is_acc',False): args['is_acc']=data['is_acc'] @@ -618,7 +622,6 @@ class pos_order(osv.osv): args['partner_id'] = order.partner_id and order.partner_id.id or None args['ref'] = order.contract_number or None - statement_obj= self.pool.get('account.bank.statement') statement_id = statement_obj.search(cr,uid, [ ('journal_id', '=', data['journal']), ('company_id', '=', curr_company), @@ -664,7 +667,7 @@ class pos_order(osv.osv): return order_line_id - def refund(self, cr, uid, ids, context={}): + def refund(self, cr, uid, ids, context=None): """Create a copy of order for refund order""" @@ -691,7 +694,7 @@ class pos_order(osv.osv): }) return clone_list - def action_invoice(self, cr, uid, ids, context={}): + def action_invoice(self, cr, uid, ids, context=None): """Create a invoice of order """ @@ -988,7 +991,7 @@ class pos_order(osv.osv): if not context: context = {} if context.get('flag',False): - self.create_picking(cr, uid, ids, context={}) + self.create_picking(cr, uid, ids, context=None) self.write(cr, uid, ids, {'state': 'paid'}) else: context['flag']=True @@ -1001,7 +1004,7 @@ class pos_order(osv.osv): def action_done(self, cr, uid, ids, context=None): for order in self.browse(cr, uid, ids, context=context): if not order.journal_entry: - self.create_account_move(cr, uid, ids, context={}) + self.create_account_move(cr, uid, ids, context=None) return True def compute_state(self, cr, uid, id): @@ -1168,30 +1171,31 @@ class pos_order_line(osv.osv): 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } - def create(self, cr, user, vals, context={}): + def create(self, cr, user, vals, context=None): if vals.get('product_id'): return super(pos_order_line, self).create(cr, user, vals, context) return False - def write(self, cr, user, ids, values, context={}): + def write(self, cr, user, ids, values, context=None): if 'product_id' in values and not values['product_id']: return False return super(pos_order_line, self).write(cr, user, ids, values, context) def _scan_product(self, cr, uid, ean, qty, order): # search pricelist_id + product_obj=self.pool.get('product.product') pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] ) if not pricelist_id: return False new_line = True - product_id = self.pool.get('product.product').search(cr, uid, [('ean13','=', ean)]) + product_id = product_obj.search(cr, uid, [('ean13','=', ean)]) if not product_id: return False # search price product - product = self.pool.get('product.product').read(cr, uid, product_id) + product =product_obj.read(cr, uid, product_id) product_name = product[0]['name'] price = self.price_by_product(cr, uid, 0, pricelist_id[0]['pricelist_id'][0], product_id[0], 1) @@ -1231,14 +1235,14 @@ class pos_payment(osv.osv): _name = 'pos.payment' _description = 'Pos Payment' - def _journal_get(self, cr, uid, context={}): + def _journal_get(self, cr, uid, context=None): obj = self.pool.get('account.journal') ids = obj.search(cr, uid, [('type', '=', 'cash')]) res = obj.read(cr, uid, ids, ['id', 'name'], context) res = [(r['id'], r['name']) for r in res] return res - def _journal_default(self, cr, uid, context={}): + def _journal_default(self, cr, uid, context=None): journal_list = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')]) if journal_list: return journal_list[0] @@ -1261,12 +1265,12 @@ class pos_payment(osv.osv): 'payment_date': lambda *a: time.strftime('%Y-%m-%d'), } - def create(self, cr, user, vals, context={}): + def create(self, cr, user, vals, context=None): if vals.get('journal_id') and vals.get('amount'): return super(pos_payment, self).create(cr, user, vals, context) return False - def write(self, cr, user, ids, values, context={}): + def write(self, cr, user, ids, values, context=None): if 'amount' in values and not values['amount']: return False if 'journal_id' in values and not values['journal_id']: @@ -1278,7 +1282,7 @@ pos_payment() class account_move_line(osv.osv): _inherit = 'account.move.line' - def create(self, cr, user, vals, context={}): + def create(self, cr, user, vals, context=None): pos_obj = self.pool.get('pos.order') val_name = vals.get('name', '') val_ref = vals.get('ref', '') @@ -1299,7 +1303,7 @@ class account_move(osv.osv): _inherit = 'account.move' - def create(self, cr, user, vals, context={}): + def create(self, cr, user, vals, context=None): pos_obj = self.pool.get('pos.order') val_name = vals.get('name', '') val_ref = vals.get('ref', '') From 04f18af0641958c3a920e782c01fdcd6537da663 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 20 Aug 2010 15:05:17 +0530 Subject: [PATCH 04/11] [REF]: base_calendar: Code improvement in unlink method of Event bzr revid: rpa@tinyerp.com-20100820093517-38px067thdcd32j4 --- addons/base_calendar/base_calendar.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index d436f6778b7..3577d989e9a 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1545,19 +1545,18 @@ true, it will allow you to hide the event alarm information without removing it. @return: True """ res = False - for event_id in ids: - if isinstance(event_id, (int, long)): - res = super(calendar_event, self).unlink(cr, uid, event_id) + for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate'], context=context): + if isinstance(event_datas['id'], (int, long)): + res = super(calendar_event, self).unlink(cr, uid, event_datas['id']) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) - continue - event_id, date_new = event_id.split('-') - event_id = [int(event_id)] - for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): - if record['rrule']: + else: + event_id, date_new = event_datas['id'].split('-') + event_id = [int(event_id)] + if event_datas['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) - exdate = (record['exdate'] and (record['exdate'] + ',') or '') + date_new + exdate = (event_datas['exdate'] and (event_datas['exdate'] + ',') or '') + date_new res = self.write(cr, uid, event_id, {'exdate': exdate}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) From 0e3529e32fd7cf5ffb66fca5adffe45747631e3c Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Fri, 20 Aug 2010 11:42:08 +0200 Subject: [PATCH 05/11] [FIX] document: reverted to previous version of __openerp__. 'certificate' was lost and 'version' was changed bzr revid: olt@tinyerp.com-20100820094208-4p0sbuuxsk0xk110 --- addons/document/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/__openerp__.py b/addons/document/__openerp__.py index 3a18406f607..16bbcd41c83 100644 --- a/addons/document/__openerp__.py +++ b/addons/document/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Integrated Document Management System', - 'version': '1.99', + 'version': '1.1', 'category': 'Generic Modules/Others', 'description': """This is a complete document management system: * User Authentication @@ -57,7 +57,7 @@ ], 'installable': True, 'active': False, - 'certificate': None, + 'certificate': '0070515416461', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 8624b0445f8a74fc2142e77cb1087994f415f656 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Fri, 20 Aug 2010 15:48:04 +0530 Subject: [PATCH 06/11] [ADD] hr_*,wiki : help on menus bzr revid: vir@tinyerp.com-20100820101804-scuqnf7j71av67tf --- addons/hr/hr_department_view.xml | 1 + addons/hr/hr_view.xml | 2 ++ addons/hr_attendance/hr_attendance_view.xml | 1 + addons/hr_evaluation/hr_evaluation_view.xml | 2 ++ addons/hr_expense/hr_expense_view.xml | 1 + addons/hr_holidays/hr_holidays_view.xml | 1 + addons/wiki/wiki_view.xml | 1 + 7 files changed, 9 insertions(+) diff --git a/addons/hr/hr_department_view.xml b/addons/hr/hr_department_view.xml index 29e3b04f2c9..1b96956394f 100644 --- a/addons/hr/hr_department_view.xml +++ b/addons/hr/hr_department_view.xml @@ -72,6 +72,7 @@ hr.department form + Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc. diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 5ebf9b81019..659ddfa36e9 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -145,6 +145,7 @@ [] + The employee directory contains all data related to your employees: from their photo up to their hourly estimated costs for the timesheets. Employees are managed by departments and can be linked to users to manage their access rights. @@ -394,6 +395,7 @@ tree,form {'search_default_Current':1} + Job Positions are used to define the jobs, the requirements. You can attach a survey to a job position. This survey will be used in the recruitement process to evaluate the applicants for this job position. diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index fb6911a6656..da3218d9c6c 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -72,6 +72,7 @@ tree,form {"search_default_employee":1} + Time Tracking functionality aims to manage employee's attendances on the basis of the actions (Sign in/Sign out) performed by them. You can also link this to an attendance machine using OpenERP's webservices features. diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 45efab642c8..55bc22ac505 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -260,6 +260,7 @@ form tree,form,graph + Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evalautions. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager. [('is_evaluation' ,'=', True)] {"search_default_todo":1,"search_default_user_id":uid} + Interview Requests are generated automatically by OpenERP according to employees evaluation plan. Each user receives automatic emails and requests to perform evaluation of their collegues periodically. form {"search_default_user_id":uid} + The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow. diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 38d9b810fcb..9e8c9d527b4 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -247,6 +247,7 @@ [('type','=','remove')] {'search_default_user_id':uid} + Leaves requests can be recorded by employees and validated by their managers. Once a leave request is validated it appears automatically in the agenda of the employee. You can define several allowance types (paid holidays, sickness, etc) and manage allowances per type. diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index d21b8f9e9cd..a22267bd52a 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -185,6 +185,7 @@ tree,form + Wiki Pages allows you to share ideas and questions with your coworkers. You can create a new document that can be link to one or several applications (CRM, Sales, etc.). You can use keywords to ease access to your wiki pages. There is a basic wiki editing for text format. Date: Fri, 20 Aug 2010 15:52:11 +0530 Subject: [PATCH 07/11] [IMP] Account: Templates configuration wizard with new company settings bzr revid: mra@mra-laptop-20100820102211-y9w19dqo3bvhfk7x --- addons/account/__openerp__.py | 2 +- addons/account/account_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 3923add4fe0..96412077840 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -52,6 +52,7 @@ module named account_voucher. 'wizard/account_statement_from_invoice_view.xml', 'wizard/account_move_bank_reconcile_view.xml', 'wizard/account_use_model_view.xml', + 'account_installer.xml', 'account_view.xml', 'account_report.xml', 'wizard/account_report_common_view.xml', @@ -108,7 +109,6 @@ module named account_voucher. 'process/supplier_invoice_process.xml', 'sequence_view.xml', 'company_view.xml', - 'account_installer.xml', 'report/account_invoice_report_view.xml', 'report/account_entries_report_view.xml', 'report/account_report_view.xml', diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index c1954e26288..5320d8554d2 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2234,7 +2234,7 @@ new - + account.account.graph From bd1f0ec92cea8ef6739b6c84bb42f1112c6ba308 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 20 Aug 2010 16:50:13 +0530 Subject: [PATCH 08/11] [IMP]: base_calendar: Removing event or its recurrence should remove all the recurrent events that share same UID values bzr revid: rpa@tinyerp.com-20100820112013-bt1pkub8irxro3hx --- addons/base_calendar/base_calendar.py | 34 +++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 3577d989e9a..1beb7e90d41 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -962,6 +962,19 @@ class calendar_event(osv.osv): return {'value': value} + def unlink_events(self, cr, uid, ids, context=None): + """ + This function deletes event which are linked with the event with recurrent_uid + (Removes the events which refers to the same UID value) + """ + if not context: + context = {} + for event_id in ids: + cr.execute('select id from %s where recurrent_uid=%s' % (self._table, event_id)) + r_ids = map(lambda x: x[0], cr.fetchall()) + self.unlink(cr, uid, r_ids, context=context) + return True + def _set_rrulestring(self, cr, uid, id, name, value, arg, context=None): """ Sets values of fields that defines event recurrence from the value of rrule string @@ -1074,6 +1087,10 @@ class calendar_event(osv.osv): else: result[event] = self.compute_rule_string(cr, uid, {'freq': datas.get('rrule_type').upper(), 'interval': 1}, context=context) + for id, myrule in result.items(): + #Remove the events generated from recurrent event + if not myrule: + self.unlink_events(cr, uid, [id], context=context) return result _columns = { @@ -1546,21 +1563,24 @@ true, it will allow you to hide the event alarm information without removing it. """ res = False for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate'], context=context): - if isinstance(event_datas['id'], (int, long)): - res = super(calendar_event, self).unlink(cr, uid, event_datas['id']) + event_id = event_datas['id'] + if isinstance(event_id, (int, long)): + res = super(calendar_event, self).unlink(cr, uid, event_id, context=context) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) + self.unlink_events(cr, uid, [event_id], context=context) else: - event_id, date_new = event_datas['id'].split('-') - event_id = [int(event_id)] + str_event, date_new = event_id.split('-') + event_id = int(str_event) if event_datas['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) exdate = (event_datas['exdate'] and (event_datas['exdate'] + ',') or '') + date_new - res = self.write(cr, uid, event_id, {'exdate': exdate}) + res = self.write(cr, uid, [event_id], {'exdate': exdate}) else: - res = super(calendar_event, self).unlink(cr, uid, event_id) - self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name) + res = super(calendar_event, self).unlink(cr, uid, [event_id], context=context) + self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name) + self.unlink_events(cr, uid, [event_id], context=context) return res def create(self, cr, uid, vals, context=None): From f2ef891e5744069002ee7cd5de63cc0ae4c746fe Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Fri, 20 Aug 2010 16:55:24 +0530 Subject: [PATCH 09/11] [IMP]:mrp:improved Cost Structure report with new report format. bzr revid: apa@tinyerp.com-20100820112524-9ttzdxbjwi0ti1qi --- addons/mrp/report/price.py | 69 +++++++++++++++++++------------------ addons/mrp/report/price.xsl | 48 ++++++++++++++++++-------- 2 files changed, 68 insertions(+), 49 deletions(-) diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 5474646c004..8890ed533d7 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -69,10 +69,10 @@ class report_custom(report_rml): xml += "" + prod_name + '' xml += "" + main_sp_name + sellers + '' - xml += "" + str(prod_qtty) + '' - xml += "" + product_uom.name + '' - xml += "" + main_strd_price + '' - xml += "" + main_sp_price + sellers_price + '' + xml += "" + str(prod_qtty) + '' + xml += "" + product_uom.name + '' + xml += "" + main_strd_price + '' + xml += "" + main_sp_price + sellers_price + '' xml += '' @@ -87,9 +87,9 @@ class report_custom(report_rml): xml += "" + workcenter.name + '' xml += "" xml += "" - xml += "" + str(cost_cycle) + '' - xml += "" + str(cost_hour) + '' - xml += "" + str(cost_hour + cost_cycle) + '' + xml += "" + str(cost_cycle) + '' + xml += "" + str(cost_hour) + '' + xml += "" + str(cost_hour + cost_cycle) + '' xml += '' return xml, total @@ -102,7 +102,7 @@ class report_custom(report_rml): 210.00mm,297.00mm 595.27 841.88 - 60.00mm,60.00mm, 20.00mm, 20.00mm, 20.00mm, 20.00mm + 55.00mm,55.00mm, 20.00mm, 22.00mm, 22.00mm, 25.00mm """ config_stop = """ Generated by OpenERP @@ -114,30 +114,30 @@ class report_custom(report_rml): %s - - %s - %s - %s + + %s + %s + %s """ % (_('Work Center name'), _('Cycles Cost'), _('Hourly Cost'),_('Work Cost')) prod_header = """ - %s - %s - %s - %s - %s - %s + %s + %s + %s + %s + %s + %s - """ % (_('Componet'), _('Componet suppliers'), _('Quantity'), _('Uom'), _('Cost Unit Price per Uom'), _('Supplier Unit Price per Uom')) + """ % (_('Componet'), _('Componet suppliers'), _('Quantity'), _('Uom'), _('Cost Price per Uom'), _('Supplier Price per Uom')) company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id.id for product in product_pool.browse(cr, uid, ids, context=context): bom_id = bom_pool._bom_find(cr, uid, product.id, product.uom_id.id) title = "%s" %(_("Cost Structure")) title += "%s" %product.name - xml += "" + title + prod_header + "" + xml += "" + title + prod_header + "" if not bom_id: total_strd = number * product.standard_price total = number * product_pool.price_get(cr, uid, [product.id], 'standard_price')[product.id] @@ -153,9 +153,9 @@ class report_custom(report_rml): %s %s %s %s : - - %s - %s + + %s + %s '"""%(_('Total Cost'), _('of'), str(number), product.uom_id.name, str(total_strd), str(total)) else: bom = bom_pool.browse(cr, uid, bom_id, context=context) @@ -164,9 +164,9 @@ class report_custom(report_rml): total = 0 total_strd = 0 parent_bom = { - 'product_qty': bom.product_qty, - 'name': bom.product_id.name, - 'product_uom': bom.product_uom.id, + 'product_qty': bom.product_qty, + 'name': bom.product_id.name, + 'product_uom': bom.product_uom.id, 'product_id': bom.product_id.id } xml_tmp = '' @@ -175,15 +175,15 @@ class report_custom(report_rml): xml_tmp += txt total += sum total_strd += sum_strd - + xml += "" + xml_tmp + '' xml += """ %s %s %s %s : - - %s - %s + + %s + %s '"""%(_('Cost'), _('of'), str(number), product.uom_id.name, str(total_strd), str(total)) total2 = 0 @@ -201,18 +201,19 @@ class report_custom(report_rml): - %s + %s '"""%(_('Work Cost'), _('of'), str(number), product.uom_id.name, str(total2)) xml += """ %s %s %s %s : - - %s - %s + + %s + %s '"""%(_('Total Cost'), _('of'), str(number), product.uom_id.name, str(total_strd+total2), str(total+total2)) xml = '' + config_start + config_stop + xml + '' + return xml report_custom('report.product.price', 'product.product', '', 'addons/mrp/report/price.xsl') diff --git a/addons/mrp/report/price.xsl b/addons/mrp/report/price.xsl index 10e088629e0..dc43c3d6f7d 100644 --- a/addons/mrp/report/price.xsl +++ b/addons/mrp/report/price.xsl @@ -3,7 +3,7 @@ - + @@ -12,35 +12,37 @@ - + + + + + - - + - + - - + - + - + @@ -66,7 +68,7 @@ - + @@ -75,22 +77,28 @@ + + + + + + @@ -105,22 +113,32 @@ - + - + - - + + - + + + + + + + + + + + From 300eea6300757a4e16d59aaad6e41d0c62df7a44 Mon Sep 17 00:00:00 2001 From: "PSI(OpenERP)" <> Date: Fri, 20 Aug 2010 17:00:54 +0530 Subject: [PATCH 10/11] [IMP] hr improvements bzr revid: mra@mra-laptop-20100820113054-mayxce6dsf6b316n --- addons/hr/hr_department_view.xml | 2 +- .../wizard/hr_attendance_bymonth_view.xml | 4 +- addons/hr_evaluation/hr_evaluation.py | 12 +-- addons/hr_holidays/hr_holidays_demo.xml | 84 +++++++++---------- .../test/test_hr_timesheet_sheet.yml | 34 +++++--- 5 files changed, 73 insertions(+), 63 deletions(-) diff --git a/addons/hr/hr_department_view.xml b/addons/hr/hr_department_view.xml index 1b96956394f..c2bb6ac7390 100644 --- a/addons/hr/hr_department_view.xml +++ b/addons/hr/hr_department_view.xml @@ -76,7 +76,7 @@ - + res.users.form diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml index 8d3aa343b15..e9b5fecf330 100644 --- a/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml +++ b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml @@ -19,7 +19,7 @@ - Attendances by month + Attendances By Month ir.actions.act_window hr.attendance.month form @@ -30,7 +30,7 @@ - Attendances by month + Attendances By Month client_print_multi action diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index b4743a7ffdc..0b497c461e0 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -36,11 +36,11 @@ class hr_evaluation_plan(osv.osv): 'month_first': fields.integer('First Evaluation After'), 'month_next': fields.integer('Next Evaluation After'), 'active': fields.boolean('Active') - } + } _defaults = { 'active': True, 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c), - } + } hr_evaluation_plan() class hr_evaluation_plan_phase(osv.osv): @@ -131,7 +131,7 @@ class hr_employee(osv.osv): evaluation_date=(dt.ISO.ParseAny(evaluation_date)+ dt.RelativeDateTime(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d') flag = True if ids and flag: - self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context) + obj_evaluation.create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context) return {'value': {'evaluation_date': evaluation_date}} def create(self, cr, uid, vals, context=None): @@ -139,7 +139,7 @@ class hr_employee(osv.osv): context = {} id = super(hr_employee, self).create(cr, uid, vals, context=context) if vals.get('evaluation_plan_id', False): - obj_evaluation.create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context) + self.pool.get('hr_evaluation.evaluation').create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context) return id hr_employee() @@ -289,10 +289,10 @@ class hr_evaluation_interview(osv.osv): 'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True), 'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'), 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'), - } + } _defaults = { 'is_evaluation': True, - } + } def survey_req_waiting_answer(self, cr, uid, ids, context=None): if context is None: diff --git a/addons/hr_holidays/hr_holidays_demo.xml b/addons/hr_holidays/hr_holidays_demo.xml index 2ea95b76620..bfa051dff7a 100644 --- a/addons/hr_holidays/hr_holidays_demo.xml +++ b/addons/hr_holidays/hr_holidays_demo.xml @@ -1,52 +1,52 @@ - + - - - Casual Leave - True - black - + + + Casual Leave + True + black + - - Casual Leave for Fabien Pinckaers - - add - 12 - - + + Casual Leave for Fabien Pinckaers + + add + 12 + + - - Trip with Family - - 2010-01-04 08:00 - 2010-01-06 18:00 - remove - 3 - - + + Trip with Family + + + + remove + 3 + + - - - Sick Leave - True - red - + + + Sick Leave + True + red + - - Doctor Appointment - - 2010-02-01 00:00 - 2010-02-03 08:00 - remove - draft - 3 - - + + Doctor Appointment + + + + remove + draft + 3 + + - - + + - + diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml index 1486d7f9bb4..d75968f5f16 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -9,6 +9,15 @@ partner_id: base.res_partner_desertic_hispafuentes timesheet_max_difference: 1.0 +- + I assign this company to Admin user +- + !record {model: res.users, id: base.user_root}: + company_id: res_company_openERP + company_ids: + - base.main_company + - res_company_openERP + - I create a new employee “Mark Johnson”. - @@ -81,7 +90,7 @@ I create Timesheet Entry for time spend on today work. - - !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}: + !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: timesheet_ids: - account_id: account.analytic_sednacom date: '05/26/2010' @@ -98,20 +107,21 @@ if the difference between timesheet hour and attendance hour is more than 1 hour it will give message. - !python {model: hr_timesheet_sheet.sheet}: | - uid = ref('base.user_root') - import netsvc - for sheet in self.browse(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')]): - di = sheet.user_id.company_id.timesheet_max_difference - if (abs(sheet.total_difference) < di) or not di: - wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr) - else: - print "Please verify that the total difference of the sheet is lower than %.2f" %di + uid = ref('base.user_root') + import netsvc + try: + self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"lang": 'en_US', "active_ids": + [ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")], "tz": False, "active_model": + "ir.ui.menu", "department_id": False, "section_id": False, "search_default_my_timesheet": + 1, "search_default_user_id": 1, "project_id": False, "active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"), + }) + except: + pass - - I Modified the timesheet record. + I Modified the timesheet record and make the difference less than 1 hour. - - !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}: + !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}: timesheet_ids: - account_id: account.analytic_sednacom date: '05/26/2010' From c1dbc408c535fdc606e1b67854e289b35b8204ff Mon Sep 17 00:00:00 2001 From: vra Date: Fri, 20 Aug 2010 17:02:18 +0530 Subject: [PATCH 11/11] [ADD] account, account_payment, analytic: added company related record rules for some objects and also added company field. bzr revid: vra@tinyerp.com-20100820113218-5xg58scsgjavb6fg --- addons/account/account.py | 2 ++ addons/account/account_view.xml | 2 ++ addons/account/security/account_security.xml | 14 ++++++++++++++ addons/account_payment/account_payment.py | 5 ++++- addons/account_payment/account_payment_view.xml | 2 ++ .../security/account_payment_security.xml | 7 +++++++ addons/analytic/__openerp__.py | 3 ++- addons/analytic/security/analytic_security.xml | 11 +++++++++++ 8 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 addons/analytic/security/analytic_security.xml diff --git a/addons/account/account.py b/addons/account/account.py index a82c39572a9..2a07154461c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1949,12 +1949,14 @@ class account_model(osv.osv): 'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"), 'ref': fields.char('Reference', size=64), 'journal_id': fields.many2one('account.journal', 'Journal', required=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), 'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'), 'legend' :fields.text('Legend', readonly=True, size=100), } _defaults = { 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id } def generate(self, cr, uid, ids, datas={}, context={}): move_ids = [] diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 5320d8554d2..111fafdd18c 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1551,6 +1551,7 @@ + @@ -1568,6 +1569,7 @@ + diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index e9360cad741..43e3e32eefd 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -222,4 +222,18 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + Account fiscal position company rule + + + [('company_id','=',user.company_id.id)] + + + + Account model company rule + + + [('company_id','=',user.company_id.id)] + + diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 15754399927..a27a2d2e72d 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -46,9 +46,12 @@ class payment_mode(osv.osv): required=True,help='Bank Account for the Payment Mode'), 'journal': fields.many2one('account.journal', 'Journal', required=True, domain=[('type', '=', 'cash')], help='Cash Journal for the Payment Mode'), + 'company_id': fields.many2one('res.company', 'Company', required=True), 'type': fields.many2one('payment.type', 'Payment type', required=True, help='Select the Payment Type for the Payment Mode.'), } - + _defaults = { + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id + } def suitable_bank_types(self, cr, uid, payment_code=None, context={}): """Return the codes of the bank type that are suitable for the given payment type code""" diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml index 880ac0de94b..4fe86cf44c6 100644 --- a/addons/account_payment/account_payment_view.xml +++ b/addons/account_payment/account_payment_view.xml @@ -69,6 +69,7 @@ + @@ -82,6 +83,7 @@ + diff --git a/addons/account_payment/security/account_payment_security.xml b/addons/account_payment/security/account_payment_security.xml index dd6b117d184..6561373bafb 100644 --- a/addons/account_payment/security/account_payment_security.xml +++ b/addons/account_payment/security/account_payment_security.xml @@ -6,5 +6,12 @@ Accounting / Payments + + Payment Mode company rule + + + [('company_id','=',user.company_id.id)] + + diff --git a/addons/analytic/__openerp__.py b/addons/analytic/__openerp__.py index 80585ee39da..1f21fb3fce3 100644 --- a/addons/analytic/__openerp__.py +++ b/addons/analytic/__openerp__.py @@ -29,7 +29,8 @@ "description": """Module for defining analytic accounting object. """, "init_xml" : [], - "update_xml": ["security/ir.model.access.csv", + "update_xml": ['security/analytic_security.xml', + "security/ir.model.access.csv", ], 'demo_xml': [ ], diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml new file mode 100644 index 00000000000..a382380d962 --- /dev/null +++ b/addons/analytic/security/analytic_security.xml @@ -0,0 +1,11 @@ + + + + + analytic company rule + + + [('company_id','=',user.company_id.id)] + + +