invoice refund won't work with account_analytic_plans module
This blueprint originated from the following bug report that couldn't be fixed for v5.0:
https:/
Hi,
take a fresh install, possibly with the accounting profile.
install the account_tax_include module
Create an invoice with some invoice lines.
In one invoice line, create an analytic distribution (analytics_id field).
Now click on "make credit note" (that will make a refund), you'll get an
ugly stack trace.
This is because relationnal fields in account.
in a very weird way the the account/
method . See the following code:
def _refund_
for line in lines:
del line['id']
del line['invoice_id']
if 'account_id' in line:
if 'product_id' in line:
if 'uos_id' in line:
if 'invoice_
if 'account_
if 'tax_code_id' in line :
if isinstance(
if 'base_code_id' in line :
if isinstance(
return map(lambda x: (0,0,x), lines)
Of course this code has the relationnal fields of account.
Soultion:
1) Avoid to hardcode those relational fields in _refund_
2) Else override _refund_
Hope this helps,
Raphaël Valyi.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
invoice refund won't work with account_
https:/
You received this bug notification because you are a direct subscriber
of the bug.
Status in OpenObject Addons Modules: New
Bug description:
Hi,
take a fresh install, possibly with the accounting profile.
install the account_tax_include module
Create an invoice with some invoice lines.
In one invoice line, create an analytic distribution (analytics_id field).
Now click on "make credit note" (that will make a refund), you'll get an ugly stack trace.
This is because relationnal fields in account.
def _refund_
for line in lines:
del line['id']
del line['invoice_id']
if 'account_id' in line:
if 'product_id' in line:
if 'uos_id' in line:
if 'invoice_
if 'account_
if 'tax_code_id' in line :
if isinstance(
if 'base_code_id' in line :
if isinstance(
return map(lambda x: (0,0,x), lines)
Of course this code has the relationnal fields of account.
Soultion:
1) Avoid to hardcode those relational fields in _refund_
2) Else override _refund_
Hope this helps,
Raphaël Valyi.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by