← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/account-invoicing/7.0_fix_period_in_refund_mdh into lp:account-invoicing

 

Matthieu Dietrich @ camptocamp has proposed merging lp:~camptocamp/account-invoicing/7.0_fix_period_in_refund_mdh into lp:account-invoicing.

Commit message:
[FIX] correctly retrieving period from form

Requested reviews:
  Account Core Editors (account-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/account-invoicing/7.0_fix_period_in_refund_mdh/+merge/201180

Fixing an existing issue; if a period is filled out in the refund wizard, an issue is raised at validation: "Column 'period_id' is of type integer but expression is of type record".

I just fixed it as the journal above it; if it is present (aka. a record (id, name)), take the ID only instead of the tuple.
-- 
https://code.launchpad.net/~camptocamp/account-invoicing/7.0_fix_period_in_refund_mdh/+merge/201180
Your team Account Core Editors is requested to review the proposed merge of lp:~camptocamp/account-invoicing/7.0_fix_period_in_refund_mdh into lp:account-invoicing.
=== modified file 'invoice_validation_wkfl/invoice.py'
--- invoice_validation_wkfl/invoice.py	2013-05-13 08:30:34 +0000
+++ invoice_validation_wkfl/invoice.py	2014-01-10 13:08:26 +0000
@@ -93,8 +93,8 @@
                     raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
                 if inv.reconciled and mode in ('cancel', 'modify'):
                     raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode))
-                if form['period']:
-                    period = form['period']
+                if form.get('period', False):
+                    period = form['period'][0]
                 else:
                     period = inv.period_id and inv.period_id.id or False
 


Follow ups