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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/register_accounting/wizard/direct_invoice.py'
--- bin/addons/register_accounting/wizard/direct_invoice.py 2016-07-21 10:12:49 +0000
+++ bin/addons/register_accounting/wizard/direct_invoice.py 2022-06-08 15:25:30 +0000
@@ -277,6 +277,8 @@
277 # Get analytic_distribution_id277 # Get analytic_distribution_id
278 distrib_id = invoice.analytic_distribution_id and invoice.analytic_distribution_id.id278 distrib_id = invoice.analytic_distribution_id and invoice.analytic_distribution_id.id
279 account_id = invoice.account_id and invoice.account_id.id279 account_id = invoice.account_id and invoice.account_id.id
280 # Get posting date
281 posting_date = invoice.date_invoice
280 # Prepare values for wizard282 # Prepare values for wizard
281 vals = {283 vals = {
282 'total_amount': amount,284 'total_amount': amount,
@@ -284,17 +286,18 @@
284 'currency_id': currency or False,286 'currency_id': currency or False,
285 'state': 'dispatch',287 'state': 'dispatch',
286 'account_id': account_id or False,288 'account_id': account_id or False,
289 'posting_date': posting_date,
287 }290 }
288 if distrib_id:291 if distrib_id:
289 vals.update({'distribution_id': distrib_id,})292 vals.update({'distribution_id': distrib_id,})
290 # Create the wizard
291 wiz_obj = self.pool.get('analytic.distribution.wizard')
292 wiz_id = wiz_obj.create(cr, uid, vals, context=context)
293 # Update some context values293 # Update some context values
294 context.update({294 context.update({
295 'active_id': ids[0],295 'active_id': ids[0],
296 'active_ids': ids,296 'active_ids': ids,
297 })297 })
298 # Create the wizard
299 wiz_obj = self.pool.get('analytic.distribution.wizard')
300 wiz_id = wiz_obj.create(cr, uid, vals, context=context)
298 # Open it!301 # Open it!
299 return {302 return {
300 'name': _('Global analytic distribution'),303 'name': _('Global analytic distribution'),
@@ -395,6 +398,8 @@
395 amount = -1 * amount398 amount = -1 * amount
396 # Get analytic distribution id from this line399 # Get analytic distribution id from this line
397 distrib_id = invoice_line and invoice_line.analytic_distribution_id and invoice_line.analytic_distribution_id.id or False400 distrib_id = invoice_line and invoice_line.analytic_distribution_id and invoice_line.analytic_distribution_id.id or False
401 # Get posting date
402 posting_date = invoice_line.invoice_id.date_invoice
398 # Prepare values for wizard403 # Prepare values for wizard
399 vals = {404 vals = {
400 'total_amount': amount,405 'total_amount': amount,
@@ -402,17 +407,18 @@
402 'currency_id': currency or False,407 'currency_id': currency or False,
403 'state': 'dispatch',408 'state': 'dispatch',
404 'account_id': invoice_line.account_id and invoice_line.account_id.id or False,409 'account_id': invoice_line.account_id and invoice_line.account_id.id or False,
410 'posting_date': posting_date,
405 }411 }
406 if distrib_id:412 if distrib_id:
407 vals.update({'distribution_id': distrib_id,})413 vals.update({'distribution_id': distrib_id,})
408 # Create the wizard
409 wiz_obj = self.pool.get('analytic.distribution.wizard')
410 wiz_id = wiz_obj.create(cr, uid, vals, context=context)
411 # Update some context values414 # Update some context values
412 context.update({415 context.update({
413 'active_id': ids[0],416 'active_id': ids[0],
414 'active_ids': ids,417 'active_ids': ids,
415 })418 })
419 # Create the wizard
420 wiz_obj = self.pool.get('analytic.distribution.wizard')
421 wiz_id = wiz_obj.create(cr, uid, vals, context=context)
416 # Open it!422 # Open it!
417 return {423 return {
418 'name': _('Analytic distribution'),424 'name': _('Analytic distribution'),

Subscribers

People subscribed via source and target branches