Merge lp:~julie-w/unifield-server/US-3669 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4915
Proposed branch: lp:~julie-w/unifield-server/US-3669
Merge into: lp:unifield-server
Diff against target: 119 lines (+20/-8)
7 files modified
bin/addons/account/wizard/account_invoice_refund.py (+3/-1)
bin/addons/account/wizard/account_invoice_refund_view.xml (+1/-1)
bin/addons/analytic_distribution/account_invoice_refund.py (+8/-5)
bin/addons/base/rng/view.rng (+1/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+1/-0)
bin/addons/register_accounting/account_invoice_view.xml (+1/-1)
bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml (+5/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-3669
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+345650@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
1=== modified file 'bin/addons/account/wizard/account_invoice_refund.py'
2--- bin/addons/account/wizard/account_invoice_refund.py 2018-02-26 16:49:46 +0000
3+++ bin/addons/account/wizard/account_invoice_refund.py 2018-05-16 09:13:31 +0000
4@@ -139,7 +139,9 @@
5 description = False
6 company = res_users_obj.browse(cr, uid, uid, context=context).company_id
7 journal_id = form.get('journal_id', False)
8- for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context):
9+ # in case of a DI refund from a register line use the dir_invoice_id in context
10+ invoice_ids = context.get('dir_invoice_id') and [context['dir_invoice_id']] or context.get('active_ids')
11+ for inv in inv_obj.browse(cr, uid, invoice_ids, context=context):
12 if inv.state in ['draft', 'proforma2', 'cancel']:
13 raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
14 if mode in ('cancel', 'modify') and inv_obj.has_one_line_reconciled(cr, uid, [inv.id], context=context):
15
16=== modified file 'bin/addons/account/wizard/account_invoice_refund_view.xml'
17--- bin/addons/account/wizard/account_invoice_refund_view.xml 2018-02-23 14:35:29 +0000
18+++ bin/addons/account/wizard/account_invoice_refund_view.xml 2018-05-16 09:13:31 +0000
19@@ -11,7 +11,7 @@
20 <separator string="Refund Invoice Options" colspan="4"/>
21 <group colspan="4" >
22 <field name="description"/>
23- <field name="journal_id"/>
24+ <field name="journal_id" required="1"/>
25 <field name="date" required="1"/>
26 <field name="period"/>
27 <field name="filter_refund"/>
28
29=== modified file 'bin/addons/analytic_distribution/account_invoice_refund.py'
30--- bin/addons/analytic_distribution/account_invoice_refund.py 2018-03-02 13:21:56 +0000
31+++ bin/addons/analytic_distribution/account_invoice_refund.py 2018-05-16 09:13:31 +0000
32@@ -40,7 +40,8 @@
33 if context is None:
34 context = {}
35 args = [('type', '=', 'sale_refund')]
36- doc_to_refund_id = context.get('active_ids') and context['active_ids'][0]
37+ # in case of a DI refund from a register line use the dir_invoice_id in context
38+ doc_to_refund_id = context.get('dir_invoice_id', False) or (context.get('active_ids') and context['active_ids'][0])
39 if doc_to_refund_id:
40 source_type = obj_inv.read(cr, uid, doc_to_refund_id, ['type'], context=context)['type']
41 if source_type in ('in_invoice', 'in_refund'):
42@@ -51,10 +52,12 @@
43 return journal and journal[0] or False
44
45 def _get_document_date(self, cr, uid, context=None):
46- active_ids = context.get('active_ids', [])
47- if active_ids:
48+ if context is None:
49+ context = {}
50+ invoice_id = context.get('dir_invoice_id') or (context.get('active_ids') and context['active_ids'][0])
51+ if invoice_id:
52 invoice_module = self.pool.get('account.invoice')
53- doc_date = invoice_module.read(cr, uid, active_ids[0], ['document_date'],
54+ doc_date = invoice_module.read(cr, uid, invoice_id, ['document_date'],
55 context=context)['document_date']
56 return doc_date
57 return time.strftime('%Y-%m-%d')
58@@ -143,7 +146,7 @@
59 def compute_refund(self, cr, uid, ids, mode='refund', context=None):
60 if mode == 'modify' or mode == 'cancel':
61 invoice_obj = self.pool.get('account.invoice')
62- inv_ids = context.get('active_ids', [])
63+ inv_ids = context.get('dir_invoice_id') and [context['dir_invoice_id']] or context.get('active_ids', [])
64 invoices = invoice_obj.browse(cr, uid, inv_ids, context=context)
65 for invoice in invoices:
66 if invoice.imported_state == 'partial':
67
68=== modified file 'bin/addons/base/rng/view.rng'
69--- bin/addons/base/rng/view.rng 2018-03-16 11:02:37 +0000
70+++ bin/addons/base/rng/view.rng 2018-05-16 09:13:31 +0000
71@@ -576,6 +576,7 @@
72 <rng:optional><rng:attribute name="colspan"/></rng:optional>
73 <rng:optional><rng:attribute name="target"/></rng:optional>
74 <rng:optional><rng:attribute name="readonly"/></rng:optional>
75+ <rng:optional><rng:attribute name="force_editable"/></rng:optional>
76 <rng:optional><rng:attribute name="context"/></rng:optional>
77 <rng:optional><rng:attribute name="confirm"/></rng:optional>
78 <rng:optional><rng:attribute name="help"/></rng:optional>
79
80=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
81--- bin/addons/msf_profile/i18n/fr_MF.po 2018-04-27 09:58:55 +0000
82+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-05-16 09:13:31 +0000
83@@ -12168,6 +12168,7 @@
84 #: view:account.invoice.report:0
85 #: report:account.invoice2:0
86 #: model:ir.actions.act_window,name:account.action_account_invoice_refund
87+#: view:account.direct.invoice.wizard:0
88 #: view:account.invoice:0
89 #: view:account.invoice:0
90 #: view:account.invoice.refund:0
91
92=== modified file 'bin/addons/register_accounting/account_invoice_view.xml'
93--- bin/addons/register_accounting/account_invoice_view.xml 2018-03-02 13:21:56 +0000
94+++ bin/addons/register_accounting/account_invoice_view.xml 2018-05-16 09:13:31 +0000
95@@ -104,7 +104,7 @@
96 <separator string="Refund Invoice Options" colspan="4"/>
97 <group colspan="4" >
98 <field name="description"/>
99- <field name="journal_id" widget='selection'/>
100+ <field name="journal_id" widget='selection' required="1"/>
101 <field name="document_date"/>
102 <field name="date" required="1"/>
103 <field name="filter_refund" readonly="1" />
104
105=== modified file 'bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml'
106--- bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml 2018-02-13 15:48:51 +0000
107+++ bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml 2018-05-16 09:13:31 +0000
108@@ -88,6 +88,11 @@
109 <group col="6" colspan="4">
110 <button name="invoice_reset_wizard" string="Reset Invoice" icon="gtk-cancel" type="object" attrs="{'invisible':['|', ('partner_id','=',False), ('date_invoice','=',False)]}"/>
111 <button name="invoice_create_wizard" string="Validate" icon="terp-camera_test" type="object"/>
112+ <field name="original_invoice_id" invisible="1"/>
113+ <button name="%(action_direct_invoice_refund)d" type='action' string='Refund'
114+ states='open,paid' icon="gtk-execute" colspan="2"
115+ context="{'dir_invoice_id': original_invoice_id}"
116+ force_editable="1"/>
117 </group>
118 </group>
119 </page>

Subscribers

People subscribed via source and target branches