Merge lp:~openerp-dev/openobject-addons/6.0-opw-54103-ado into lp:openobject-addons/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 4974
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-54103-ado
Merge into: lp:openobject-addons/6.0
Diff against target: 40 lines (+6/-1)
2 files modified
hr_expense/hr_expense.py (+5/-0)
hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-54103-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+86795@code.launchpad.net

Description of the change

Hello,

[FIX] Making of invoice based on expense lines from expense sheet is not considering invoice factor as discount"

1). Create new expense sheet for employee.
2). Add expense line with account which has Reinvoice Costs.
3). Confirm it, approve it and create invoice.

It not considering the Reinvoice Cost as discount in Invoice.

Thanks,
Amit

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

4974. By Amit Dodiya (OpenERP)

 [FIX] Making of invoice based on expense lines from expense sheet is not considering invoice factor as discount

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_expense/hr_expense.py'
2--- hr_expense/hr_expense.py 2011-06-02 05:14:55 +0000
3+++ hr_expense/hr_expense.py 2011-12-23 10:52:42 +0000
4@@ -129,6 +129,7 @@
5 sequence_obj = self.pool.get('ir.sequence')
6 analytic_journal_obj = self.pool.get('account.analytic.journal')
7 account_journal = self.pool.get('account.journal')
8+ discount = 0.0
9 for exp in self.browse(cr, uid, ids):
10 lines = []
11 for l in exp.line_ids:
12@@ -142,11 +143,15 @@
13 acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category')
14 if not acc:
15 raise osv.except_osv(_('Error !'), _('Please configure Default Expense account for Product purchase, `property_account_expense_categ`'))
16+
17+ if 'to_invoice' in l.analytic_account :
18+ discount = l.analytic_account.to_invoice.factor
19
20 lines.append((0, False, {
21 'name': l.name,
22 'account_id': acc.id,
23 'price_unit': l.unit_amount,
24+ 'discount': discount,
25 'quantity': l.unit_quantity,
26 'uos_id': l.uom_id.id,
27 'product_id': l.product_id and l.product_id.id or False,
28
29=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py'
30--- hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py 2011-04-21 07:51:29 +0000
31+++ hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py 2011-12-23 10:52:42 +0000
32@@ -147,7 +147,7 @@
33 curr_line = {
34 'price_unit': account.amount_max - amount_total,
35 'quantity': 1.0,
36- 'discount': 0.0,
37+ 'discount': account.to_invoice.factor,
38 'invoice_line_tax_id': [(6,0,tax)],
39 'invoice_id': last_invoice,
40 'name': product.name,