Merge lp:~dorian-kemps/unifield-server/US-1531 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4733
Proposed branch: lp:~dorian-kemps/unifield-server/US-1531
Merge into: lp:unifield-server
Diff against target: 51 lines (+15/-3)
2 files modified
bin/addons/account/invoice.py (+9/-1)
bin/addons/account_override/invoice.py (+6/-2)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-1531
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+335837@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/account/invoice.py'
--- bin/addons/account/invoice.py 2017-10-20 09:43:54 +0000
+++ bin/addons/account/invoice.py 2018-01-12 08:49:32 +0000
@@ -425,7 +425,11 @@
425 def get_log_context(self, cr, uid, context=None):425 def get_log_context(self, cr, uid, context=None):
426 if context is None:426 if context is None:
427 context = {}427 context = {}
428 res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form')428 is_intermission = context.get('is_intermission', False)
429 if is_intermission:
430 res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_override', 'view_intermission_form')
431 else:
432 res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form')
429 view_id = res and res[1] or False433 view_id = res and res[1] or False
430 context.update({'view_id': view_id})434 context.update({'view_id': view_id})
431 return context435 return context
@@ -437,10 +441,14 @@
437 res = super(account_invoice, self).create(cr, uid, vals, context)441 res = super(account_invoice, self).create(cr, uid, vals, context)
438 for inv_id, name in self.name_get(cr, uid, [res], context=context):442 for inv_id, name in self.name_get(cr, uid, [res], context=context):
439 ctx = context.copy()443 ctx = context.copy()
444 if 'is_intermission' in vals:
445 ctx.update({'is_intermission': vals['is_intermission']})
440 if vals.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):446 if vals.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
441 ctx = self.get_log_context(cr, uid, context=ctx)447 ctx = self.get_log_context(cr, uid, context=ctx)
442 if 'type' in vals:448 if 'type' in vals:
443 ctx.update({'type': vals['type']})449 ctx.update({'type': vals['type']})
450 if '_terp_view_name' in ctx:
451 del ctx['_terp_view_name']
444 message = _("Invoice '%s' is waiting for validation.") % name452 message = _("Invoice '%s' is waiting for validation.") % name
445 self.log(cr, uid, inv_id, message, context=ctx)453 self.log(cr, uid, inv_id, message, context=ctx)
446 return res454 return res
447455
=== modified file 'bin/addons/account_override/invoice.py'
--- bin/addons/account_override/invoice.py 2017-10-27 15:15:11 +0000
+++ bin/addons/account_override/invoice.py 2018-01-12 08:49:32 +0000
@@ -698,9 +698,13 @@
698 local_ctx.update(el[2])698 local_ctx.update(el[2])
699 # UF-1112: Give all customer invoices a name as "Stock Transfer Voucher".699 # UF-1112: Give all customer invoices a name as "Stock Transfer Voucher".
700 if not message_changed and self.read(cr, uid, inv_id, ['type']).get('type', False) == 'out_invoice':700 if not message_changed and self.read(cr, uid, inv_id, ['type']).get('type', False) == 'out_invoice':
701 message = re.sub(pattern, 'Stock Transfer Voucher', message, 1)701 if local_ctx.get('is_intermission', False):
702 message = re.sub(pattern, 'Intermission Voucher', message, 1)
703 local_ctx.update(intermission_ctx)
704 else:
705 message = re.sub(pattern, 'Stock Transfer Voucher', message, 1)
706 local_ctx.update(customer_ctx)
702707
703 local_ctx.update(customer_ctx)
704 # UF-1307: for supplier invoice log (from the incoming shipment), the context was not708 # UF-1307: for supplier invoice log (from the incoming shipment), the context was not
705 # filled with all the information; this leaded to having a "Sale" journal in the supplier709 # filled with all the information; this leaded to having a "Sale" journal in the supplier
706 # invoice if it was saved after coming from this link. Here's the fix.710 # invoice if it was saved after coming from this link. Here's the fix.

Subscribers

People subscribed via source and target branches