Merge lp:~mukunde/unifield-server/US-9500 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6258
Proposed branch: lp:~mukunde/unifield-server/US-9500
Merge into: lp:unifield-server
Diff against target: 65 lines (+12/-6)
1 file modified
bin/addons/register_accounting/wizard/direct_invoice.py (+12/-6)
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-9500
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+424196@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jftempo (jfb-tempo-consulting) wrote :

Gaël
J'ai juste une question ci-dessous concernant le context.
Merci.

lp:~mukunde/unifield-server/US-9500 updated
6242. By Gaël Mukunde

US-9500 [IMP] Remove unnecessary code

6243. By Gaël Mukunde

US-9500 [IMP] Update comments

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/register_accounting/wizard/direct_invoice.py'
2--- bin/addons/register_accounting/wizard/direct_invoice.py 2016-07-21 10:12:49 +0000
3+++ bin/addons/register_accounting/wizard/direct_invoice.py 2022-06-08 15:25:30 +0000
4@@ -277,6 +277,8 @@
5 # Get analytic_distribution_id
6 distrib_id = invoice.analytic_distribution_id and invoice.analytic_distribution_id.id
7 account_id = invoice.account_id and invoice.account_id.id
8+ # Get posting date
9+ posting_date = invoice.date_invoice
10 # Prepare values for wizard
11 vals = {
12 'total_amount': amount,
13@@ -284,17 +286,18 @@
14 'currency_id': currency or False,
15 'state': 'dispatch',
16 'account_id': account_id or False,
17+ 'posting_date': posting_date,
18 }
19 if distrib_id:
20 vals.update({'distribution_id': distrib_id,})
21- # Create the wizard
22- wiz_obj = self.pool.get('analytic.distribution.wizard')
23- wiz_id = wiz_obj.create(cr, uid, vals, context=context)
24 # Update some context values
25 context.update({
26 'active_id': ids[0],
27 'active_ids': ids,
28 })
29+ # Create the wizard
30+ wiz_obj = self.pool.get('analytic.distribution.wizard')
31+ wiz_id = wiz_obj.create(cr, uid, vals, context=context)
32 # Open it!
33 return {
34 'name': _('Global analytic distribution'),
35@@ -395,6 +398,8 @@
36 amount = -1 * amount
37 # Get analytic distribution id from this line
38 distrib_id = invoice_line and invoice_line.analytic_distribution_id and invoice_line.analytic_distribution_id.id or False
39+ # Get posting date
40+ posting_date = invoice_line.invoice_id.date_invoice
41 # Prepare values for wizard
42 vals = {
43 'total_amount': amount,
44@@ -402,17 +407,18 @@
45 'currency_id': currency or False,
46 'state': 'dispatch',
47 'account_id': invoice_line.account_id and invoice_line.account_id.id or False,
48+ 'posting_date': posting_date,
49 }
50 if distrib_id:
51 vals.update({'distribution_id': distrib_id,})
52- # Create the wizard
53- wiz_obj = self.pool.get('analytic.distribution.wizard')
54- wiz_id = wiz_obj.create(cr, uid, vals, context=context)
55 # Update some context values
56 context.update({
57 'active_id': ids[0],
58 'active_ids': ids,
59 })
60+ # Create the wizard
61+ wiz_obj = self.pool.get('analytic.distribution.wizard')
62+ wiz_id = wiz_obj.create(cr, uid, vals, context=context)
63 # Open it!
64 return {
65 'name': _('Analytic distribution'),

Subscribers

People subscribed via source and target branches