Merge lp:~unifield-team/unifield-addons/jfb-utp-766 into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4593
Proposed branch: lp:~unifield-team/unifield-addons/jfb-utp-766
Merge into: lp:unifield-addons
Diff against target: 61 lines (+22/-3)
2 files modified
account/account.py (+12/-0)
account/account_move_line.py (+10/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/jfb-utp-766
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+191127@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2013-07-12 14:29:50 +0000
+++ account/account.py 2013-10-15 09:04:06 +0000
@@ -1398,6 +1398,16 @@
13981398
1399 return True1399 return True
14001400
1401 def _hook_check_move_line(self, cr, uid, move_line, context=None):
1402 """
1403 Some checks on move line
1404 """
1405 if not context:
1406 context = {}
1407 if not move_line:
1408 return False
1409 return True
1410
1401 #1411 #
1402 # Validate a balanced move. If it is a centralised journal, create a move.1412 # Validate a balanced move. If it is a centralised journal, create a move.
1403 #1413 #
@@ -1429,6 +1439,8 @@
1429 line_draft_ids = []1439 line_draft_ids = []
1430 company_id = None1440 company_id = None
1431 for line in move.line_id:1441 for line in move.line_id:
1442 # Hook to check line
1443 self._hook_check_move_line(cr, uid, line, context=context)
1432 amount += line.debit - line.credit1444 amount += line.debit - line.credit
1433 line_ids.append(line.id)1445 line_ids.append(line.id)
1434 if line.state=='draft':1446 if line.state=='draft':
14351447
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2013-05-24 15:37:40 +0000
+++ account/account_move_line.py 2013-10-15 09:04:06 +0000
@@ -1245,10 +1245,15 @@
1245 journal_obj = self.pool.get('account.journal')1245 journal_obj = self.pool.get('account.journal')
1246 if context is None:1246 if context is None:
1247 context = {}1247 context = {}
1248 move_date = False
1248 if vals.get('move_id', False):1249 if vals.get('move_id', False):
1249 company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False)1250 move_data = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id', 'date'])
1250 if company_id:1251 if move_data.get('company_id'):
1251 vals['company_id'] = company_id[0]1252 vals['company_id'] = move_data['company_id'][0]
1253 move_date = move_data.get('date')
1254 if not vals.get('date') and move_date:
1255 vals['date'] = move_date
1256
1252 self._check_date(cr, uid, vals, context, check)1257 self._check_date(cr, uid, vals, context, check)
1253 if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:1258 if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
1254 raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))1259 raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
@@ -1391,6 +1396,8 @@
13911396
1392 if check and ((not context.get('no_store_function')) or journal.entry_posted):1397 if check and ((not context.get('no_store_function')) or journal.entry_posted):
1393 tmp = move_obj.validate(cr, uid, [vals['move_id']], context)1398 tmp = move_obj.validate(cr, uid, [vals['move_id']], context)
1399 if vals.get('date') and vals.get('date') != move_date:
1400 move_obj.write(cr, uid, [vals['move_id']], {'date': vals.get('date')}, context)
1394 if journal.entry_posted and tmp:1401 if journal.entry_posted and tmp:
1395 move_obj.button_validate(cr,uid, [vals['move_id']], context)1402 move_obj.button_validate(cr,uid, [vals['move_id']], context)
1396 return result1403 return result

Subscribers

People subscribed via source and target branches

to all changes: