diff --git a/addons/account/account.py b/addons/account/account.py index 5fd45977905..004b6610cf2 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -78,7 +78,7 @@ class account_payment_term_line(osv.osv): 'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True), 'value_amount': fields.float('Value Amount'), 'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month."), - 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the end of the month)."), + 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), 'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True), } _defaults = { @@ -681,6 +681,7 @@ account_fiscalyear() class account_move(osv.osv): _name = "account.move" _description = "Account Entry" + _order = 'id desc' def name_get(self, cursor, user, ids, context=None): if not len(ids): @@ -712,15 +713,15 @@ class account_move(osv.osv): return result _columns = { - 'name': fields.char('Entry Number', size=64, required=True), + 'name': fields.char('Number', size=64, required=True), 'ref': fields.char('Ref', size=64), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}), 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'Status', required=True, readonly=True), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Be Verified'), - 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True), - 'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2), store=True), + 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"), + 'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2)), 'type': fields.selection([ ('pay_voucher','Cash Payment'), ('bank_pay_voucher','Bank Payment'), diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index e2b06ce9b78..75dc00a0eeb 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -137,24 +137,26 @@ 2
- - - - + + + + + + + + - - - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d32e2c7b003..b0c917ffc6a 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -110,7 +110,11 @@ class account_move_line(osv.osv): account = journal_obj.default_credit_account_id else: account = journal_obj.default_debit_account_id - data['account_id'] = account.id + + + if account and ((not fields) or ('debit' in fields) or ('credit' in fields)): + data['account_id'] = account.id + s = -total_new data['debit'] = s>0 and s or 0.0 data['credit'] = s<0 and -s or 0.0 @@ -122,7 +126,6 @@ class account_move_line(osv.osv): return data period_obj = self.pool.get('account.period') - tax_obj=self.pool.get('account.tax') # Compute the current move move_id = False @@ -190,7 +193,13 @@ class account_move_line(osv.osv): else: account = move.journal_id.default_debit_account_id - data['account_id'] = account.id + if account and ((not fields) or ('debit' in fields) or ('credit' in fields)): + data['account_id'] = account.id + # Propose the price VAT excluded, the VAT will be added when confirming line + if account.tax_ids: + tax = account.tax_ids + for t in self.pool.get('account.tax').compute_inv(cr, uid, tax, total, 1): + total -= t['amount'] s = -total data['debit'] = s>0 and s or 0.0 @@ -339,7 +348,7 @@ class account_move_line(osv.osv): #TODO: remove this 'amount_taxed':fields.float("Taxed Amount",digits=(16,2)), 'parent_move_lines':fields.many2many('account.move.line', 'account_move_line_rel', 'child_id', 'parent_id', 'Parent'), - 'reconcile_implicit':fields.boolean('Implicit Reconciliaiton') + 'reconcile_implicit':fields.boolean('Implicit Reconciliation') } def _get_date(self, cr, uid, context): @@ -778,9 +787,8 @@ class account_move_line(osv.osv): if not vals.get('move_id', False): if journal.sequence_id: - name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) + #name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) v = { - 'name': name, 'period_id': context['period_id'], 'journal_id': context['journal_id'] } diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 85a2d50f84b..1cc773ef2ee 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -665,14 +665,13 @@ - + - - + + - - + @@ -724,10 +723,10 @@ - + @@ -800,13 +799,14 @@ tree - - + + - + + @@ -824,8 +824,10 @@ - + + +
@@ -862,6 +864,8 @@ + + @@ -1330,7 +1334,6 @@ - diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 96da3233651..7f8f1bbb1d0 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -187,23 +187,23 @@ class account_invoice(osv.osv): 'move_id': fields.many2one('account.move', 'Invoice Movement', readonly=True, help="Link to the automatically generated account moves."), 'amount_untaxed': fields.function(_amount_all, method=True, digits=(16,2),string='Untaxed', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'amount_tax': fields.function(_amount_all, method=True, digits=(16,2), string='Tax', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'amount_total': fields.function(_amount_all, method=True, digits=(16,2), string='Total', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), @@ -217,8 +217,9 @@ class account_invoice(osv.osv): 'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'), 'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 12), - 'account.invoice.tax': (_get_invoice_tax, None, 12), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 50), + 'account.invoice.tax': (_get_invoice_tax, None, 50), + 'account.invoice.line': (_get_invoice_line, None, 50), }, help="Remaining amount due."), 'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'), diff --git a/addons/account_tax_include/invoice_tax_incl.py b/addons/account_tax_include/invoice_tax_incl.py index 68b4a944966..36abef3fe5e 100644 --- a/addons/account_tax_include/invoice_tax_incl.py +++ b/addons/account_tax_include/invoice_tax_incl.py @@ -107,9 +107,9 @@ class account_invoice_line(osv.osv): return result.keys() _columns = { 'price_subtotal': fields.function(_amount_line2, method=True, string='Subtotal w/o tax', multi='amount', - store={'account.invoice':(_get_invoice,['price_type']), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None)}), + store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None,10)}), 'price_subtotal_incl': fields.function(_amount_line2, method=True, string='Subtotal', multi='amount', - store={'account.invoice':(_get_invoice,['price_type']), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None)}), + store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None,10)}), } _defaults = { diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 2ff5c122472..db555876467 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -38,7 +38,10 @@ class delivery_carrier(osv.osv): if order_id: order = sale_obj.browse(cr, uid, [order_id])[0] carrier_grid=self.grid_get(cr,uid,[carrier.id],order.partner_shipping_id.id,context) - price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context) + if carrier_grid: + price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context) + else: + price = 0.0 res[carrier.id]=price return res _columns = { diff --git a/addons/document/ftpserver/abstracted_fs.py b/addons/document/ftpserver/abstracted_fs.py index 9cc0f2d5868..c0f0bdf3407 100644 --- a/addons/document/ftpserver/abstracted_fs.py +++ b/addons/document/ftpserver/abstracted_fs.py @@ -70,6 +70,7 @@ class abstracted_fs: # Ok def db_list(self): + return pooler.pool_dic.keys() s = netsvc.LocalService('db') result = s.list() self.db_name_list = [] @@ -89,8 +90,9 @@ class abstracted_fs: finally: if cr is not None: cr.close() - if db is not None: - pooler.close_db(db_name) + #if db is not None: + # pooler.close_db(db_name) + print 'Return', self.db_name_list return self.db_name_list # Ok diff --git a/addons/hr_attendance/__terp__.py b/addons/hr_attendance/__terp__.py index 10abc85aa66..3ffc44ac9a7 100644 --- a/addons/hr_attendance/__terp__.py +++ b/addons/hr_attendance/__terp__.py @@ -21,7 +21,7 @@ ############################################################################## { "name" : "Attendances Of Employees", - "version" : "1.0", + "version" : "1.1", "author" : "Tiny", "category" : "Generic Modules/Human Resources", "description": "This module aims to manage employee's attendances.", diff --git a/addons/hr_attendance/hr_attendance_demo.xml b/addons/hr_attendance/hr_attendance_demo.xml index 640d6b5257a..93908662470 100644 --- a/addons/hr_attendance/hr_attendance_demo.xml +++ b/addons/hr_attendance/hr_attendance_demo.xml @@ -1,10 +1,8 @@ - - - + - + sign_in diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 5935bc4aca1..331af2aeb99 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -776,7 +776,15 @@ class mrp_procurement(osv.osv): 'property_ids': fields.many2many('mrp.property', 'mrp_procurement_property_rel', 'procurement_id','property_id', 'Properties'), 'message': fields.char('Latest error', size=64), - 'state': fields.selection([('draft','Draft'),('confirmed','Confirmed'),('exception','Exception'),('running','Running'),('cancel','Cancel'),('done','Done'),('waiting','Waiting')], 'Status') + 'state': fields.selection([ + ('draft','Draft'), + ('confirmed','Confirmed'), + ('exception','Exception'), + ('running','Running'), + ('cancel','Cancel'), + ('ready','Ready'), + ('done','Done'), + ('waiting','Waiting')], 'Status') } _defaults = { 'state': lambda *a: 'draft', @@ -1072,7 +1080,7 @@ class mrp_procurement(osv.osv): return True def action_check_finnished(self, cr, uid, ids): - return True + return self.check_move_done(cr, uid, ids) def action_check(self, cr, uid, ids): ok = False @@ -1082,17 +1090,21 @@ class mrp_procurement(osv.osv): ok = True return ok + def action_ready(self, cr, uid, ids): + res = self.write(cr, uid, ids, {'state':'ready'}) + return res + def action_done(self, cr, uid, ids): for procurement in self.browse(cr, uid, ids): if procurement.move_id: if procurement.close_move and (procurement.move_id.state <> 'done'): self.pool.get('stock.move').action_done(cr, uid, [procurement.move_id.id]) res = self.write(cr, uid, ids, {'state':'done', 'date_close':time.strftime('%Y-%m-%d')}) - wf_service = netsvc.LocalService("workflow") for id in ids: wf_service.trg_trigger(uid, 'mrp.procurement', id, cr) return res + def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None): ''' use_new_cursor: False or the dbname diff --git a/addons/mrp/mrp_order_point.xml b/addons/mrp/mrp_order_point.xml index aa6909e2601..ba2e56e8515 100644 --- a/addons/mrp/mrp_order_point.xml +++ b/addons/mrp/mrp_order_point.xml @@ -10,7 +10,7 @@ - + 50.0 @@ -18,7 +18,7 @@ - + 20.0 @@ -26,7 +26,7 @@ - + 50.0 @@ -34,7 +34,7 @@ - + 5.0 @@ -42,7 +42,7 @@ - + 50.0 @@ -50,7 +50,7 @@ - + diff --git a/addons/mrp/mrp_workflow.xml b/addons/mrp/mrp_workflow.xml index 74fe78b64c0..69c7840ceaf 100644 --- a/addons/mrp/mrp_workflow.xml +++ b/addons/mrp/mrp_workflow.xml @@ -185,7 +185,9 @@ - done + ready + function + action_ready() @@ -301,14 +303,9 @@ - check_move_done() - stock.move - [move_id.id] - - - - - check_move_cancel() + True + + @@ -348,8 +345,8 @@ - - not action_check_finnished() + + check_move_cancel() diff --git a/addons/product/product.py b/addons/product/product.py index 56a96a4258d..74d9549a78c 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -337,7 +337,10 @@ class product_product(osv.osv): pricelist = context.get('pricelist', False) if pricelist: for id in ids: - price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] + try: + price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] + except: + price = 0.0 res[id] = price for id in ids: res.setdefault(id, 0.0) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 0159e019572..17813b80bdf 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -249,8 +249,8 @@ on_change="onchange_planned(planned_hours,effective_hours)"/> - -