Merge lp:~unifield-team/unifield-server/us-724 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merge reported by: jftempo
Merged at revision: not available
Proposed branch: lp:~unifield-team/unifield-server/us-724
Merge into: lp:unifield-server
Diff against target: 71 lines (+18/-9)
4 files modified
bin/addons/register_accounting/account_bank_statement.py (+2/-1)
bin/addons/register_accounting/account_move_line.py (+1/-1)
bin/addons/register_accounting/wizard/import_invoice_on_registers.py (+14/-6)
bin/addons/register_accounting/wizard/import_invoice_on_registers_view.xml (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-724
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+289333@code.launchpad.net
To post a comment you must log in.
3624. By Vincent GREINER

[FIX] [TYPO] tax user type

3625. By Vincent GREINER

US-724 [FIX] pending payment, importable invoices: only import not already imported invoices (we do this bc check with invoice_line_id==False was not enough => tax move lines are never tied to an invoice line id

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/register_accounting/account_bank_statement.py'
2--- bin/addons/register_accounting/account_bank_statement.py 2016-03-16 16:44:07 +0000
3+++ bin/addons/register_accounting/account_bank_statement.py 2016-03-21 14:49:11 +0000
4@@ -1755,7 +1755,8 @@
5 res_ml_ids = []
6 process_invoice_move_line_ids = []
7 total_payment = True
8- if st_line.first_move_line_id.amount_currency != total_amount:
9+ diff = st_line.first_move_line_id.amount_currency - total_amount
10+ if abs(diff) > 0.001:
11 # multi unpartial payment
12 total_payment = False
13 # Delete them
14
15=== modified file 'bin/addons/register_accounting/account_move_line.py'
16--- bin/addons/register_accounting/account_move_line.py 2015-08-14 12:34:44 +0000
17+++ bin/addons/register_accounting/account_move_line.py 2016-03-21 14:49:11 +0000
18@@ -97,7 +97,7 @@
19 default_account = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.import_invoice_default_account
20 if default_account:
21 dom1.append(('account_id', '!=', default_account.id))
22- return dom1+[('amount_residual_import_inv', '>', 0)]
23+ return dom1+[('amount_residual_import_inv', '>', 0.001)]
24
25 # @@override account.account_move_line _amount_residual()
26 def _amount_residual_import_inv(self, cr, uid, ids, field_names, args, context=None):
27
28=== modified file 'bin/addons/register_accounting/wizard/import_invoice_on_registers.py'
29--- bin/addons/register_accounting/wizard/import_invoice_on_registers.py 2015-10-22 09:26:59 +0000
30+++ bin/addons/register_accounting/wizard/import_invoice_on_registers.py 2016-03-21 14:49:11 +0000
31@@ -67,13 +67,21 @@
32 ids = [ids]
33 if context is None:
34 context = {}
35+ msg = False
36+
37+ # Amount check
38+ for l in self.read(cr, uid, ids, ['amount_to_pay']):
39+ if vals['amount'] < 0:
40+ msg = _('Negative amount are forbidden!')
41+ elif vals['amount'] > abs(l['amount_to_pay']):
42+ msg = _("Amount %.2f can't be greater than 'Amount to pay': %.2f") % (vals['amount'], abs(l['amount_to_pay']))
43+ if msg:
44+ # reset wrong amount
45+ vals = { 'amount': abs(l['amount_to_pay']) }
46+
47 res = super(wizard_import_invoice_lines, self).write(cr,uid, ids, vals, context=context)
48- # Amount check
49- for l in self.read(cr, uid, ids, ['amount', 'amount_to_pay']):
50- if l['amount'] < 0:
51- raise osv.except_osv(_('Warning'), _('Negative amount are forbidden!'))
52- if l['amount'] > abs(l['amount_to_pay']):
53- raise osv.except_osv(_('Warning'), _("Amount %.2f can't be greater than 'Amount to pay': %.2f")%(vals['amount'], abs(l['amount_to_pay'])))
54+ if msg:
55+ raise osv.except_osv(_('Warning'), msg)
56 return res
57
58 wizard_import_invoice_lines()
59
60=== modified file 'bin/addons/register_accounting/wizard/import_invoice_on_registers_view.xml'
61--- bin/addons/register_accounting/wizard/import_invoice_on_registers_view.xml 2015-07-16 15:46:18 +0000
62+++ bin/addons/register_accounting/wizard/import_invoice_on_registers_view.xml 2016-03-21 14:49:11 +0000
63@@ -33,7 +33,7 @@
64 <form string="Import Entries">
65 <group colspan="4" expand="1">
66 <separator string="Payable and Receivables" colspan="4"/>
67- <field name="line_ids" domain="[('ready_for_import_in_register','=',True), ('currency_id', '=', currency_id), ('invoice_line_id', '=', False)]"
68+ <field name="line_ids" domain="[('ready_for_import_in_register','=',True), ('currency_id', '=', currency_id), ('invoice_line_id', '=', False), ('imported_invoice_line_ids', '=', False)]"
69 context="{'from': 'wizard_import_invoice'}" colspan="4" nolabel="1">
70 <tree string="Account Entry Lines" editable="top" noteditable="True">
71 <field name="invoice"/>

Subscribers

People subscribed via source and target branches

to all changes: