Merge lp:~unifield-team/unifield-wm/utp-594 into lp:unifield-wm

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~unifield-team/unifield-wm/utp-594
Merge into: lp:unifield-wm
Diff against target: 84 lines (+21/-2)
3 files modified
account_override/invoice.py (+7/-1)
analytic_distribution/invoice.py (+12/-1)
msf_chart_of_account/data/journal_data.xml (+2/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/utp-594
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+236334@code.launchpad.net
To post a comment you must log in.
2233. By Olivier DOSSMANN

UTP-594 [FIX] Missing comma in the code

2234. By Olivier DOSSMANN

UTP-594 [FIX] Bug from UTP-1044 about a missing value in journal's data

2235. By Olivier DOSSMANN

UTP-594 [FIX] Problems to make a refund

2236. By Olivier DOSSMANN

UTP-594 [FIX] Ajout de la référence aux Journal Items depuis une refund

2237. By Olivier DOSSMANN

UTP-594 [MERGE] Last unifield trunk

Unmerged revisions

2237. By Olivier DOSSMANN

UTP-594 [MERGE] Last unifield trunk

2236. By Olivier DOSSMANN

UTP-594 [FIX] Ajout de la référence aux Journal Items depuis une refund

2235. By Olivier DOSSMANN

UTP-594 [FIX] Problems to make a refund

2234. By Olivier DOSSMANN

UTP-594 [FIX] Bug from UTP-1044 about a missing value in journal's data

2233. By Olivier DOSSMANN

UTP-594 [FIX] Missing comma in the code

2232. By Olivier DOSSMANN

UTP-594 [ADD] Link to the previous invoice when we are in a refund

2231. By Olivier DOSSMANN

UTP-594 [ADD] New link to the original invoice from which this refund comes from

2230. By Vincent GREINER

[IMP] invoice refund: hook when validate a refund

2228. By jftempo

UTP-1209 [FIX] Unable to save an AD on PO/FO

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_override/invoice.py'
--- account_override/invoice.py 2014-09-05 08:12:52 +0000
+++ account_override/invoice.py 2014-09-30 15:29:14 +0000
@@ -217,6 +217,7 @@
217 states={'draft':[('readonly',False)]}),217 states={'draft':[('readonly',False)]}),
218 'register_posting_date': fields.date(string="Register posting date for Direct Invoice", required=False),218 'register_posting_date': fields.date(string="Register posting date for Direct Invoice", required=False),
219 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True),219 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True),
220 'refund_source_inv_id': fields.many2one('account.invoice', 'Source invoice of the refund', readonly=True, invisible=True, help="Link to the invoice from which this one exists. The original one have generated this one via a refund wizard/button."),
220 }221 }
221222
222 _defaults = {223 _defaults = {
@@ -744,7 +745,10 @@
744 if not context:745 if not context:
745 context = {}746 context = {}
746 res = super(account_invoice, self).line_get_convert(cr, uid, x, part, date, context)747 res = super(account_invoice, self).line_get_convert(cr, uid, x, part, date, context)
747 res.update({'invoice_line_id': x.get('invoice_line_id', False)})748 res.update({
749 'invoice_line_id': x.get('invoice_line_id', False),
750 'reference': x.get('reference', False),
751 })
748 return res752 return res
749753
750 def finalize_invoice_move_lines(self, cr, uid, inv, line):754 def finalize_invoice_move_lines(self, cr, uid, inv, line):
@@ -765,6 +769,8 @@
765 for el in line:769 for el in line:
766 if el[2]:770 if el[2]:
767 el[2].update({'document_date': inv.document_date})771 el[2].update({'document_date': inv.document_date})
772 if inv.refund_source_inv_id:
773 el[2].update({'reference': inv.origin})
768 if el[2] and is_partner_line(el[2]):774 if el[2] and is_partner_line(el[2]):
769 el[2].update({'invoice_partner_link': inv.id})775 el[2].update({'invoice_partner_link': inv.id})
770 new_line.append((el[0], el[1], el[2]))776 new_line.append((el[0], el[1], el[2]))
771777
=== modified file 'analytic_distribution/invoice.py'
--- analytic_distribution/invoice.py 2014-05-09 12:41:01 +0000
+++ analytic_distribution/invoice.py 2014-09-30 15:29:14 +0000
@@ -143,15 +143,26 @@
143 """143 """
144 Reverse lines for given invoice144 Reverse lines for given invoice
145 """145 """
146 # Prepare some values
146 if isinstance(ids, (int, long)):147 if isinstance(ids, (int, long)):
147 ids = [ids]148 ids = [ids]
149 new_ids = []
150 # Process source invoices
148 for inv in self.browse(cr, uid, ids):151 for inv in self.browse(cr, uid, ids):
149 # Check for dates (refund must be done after invoice)152 # Check for dates (refund must be done after invoice)
150 if date and date < inv.date_invoice:153 if date and date < inv.date_invoice:
151 raise osv.except_osv(_('Error'), _("Posting date for the refund is before the invoice's posting date!"))154 raise osv.except_osv(_('Error'), _("Posting date for the refund is before the invoice's posting date!"))
152 if document_date and document_date < inv.document_date:155 if document_date and document_date < inv.document_date:
153 raise osv.except_osv(_('Error'), _("Document date for the refund is before the invoice's document date!"))156 raise osv.except_osv(_('Error'), _("Document date for the refund is before the invoice's document date!"))
154 new_ids = super(account_invoice, self).refund(cr, uid, ids, date, period_id, description, journal_id)157 new_id = super(account_invoice, self).refund(cr, uid, [inv.id], date, period_id, description, journal_id)
158 # UTP-594: Add Source Document on new invoice (origin field) and a link to the original invoice
159 if isinstance(new_id, (int, long)):
160 new_id = [new_id]
161 self.write(cr, uid, new_id, {
162 'origin': inv.number,
163 'refund_source_inv_id': inv.id,
164 })
165 new_ids += new_id
155 # add document date166 # add document date
156 if document_date:167 if document_date:
157 self.write(cr, uid, new_ids, {'document_date': document_date})168 self.write(cr, uid, new_ids, {'document_date': document_date})
158169
=== modified file 'msf_chart_of_account/data/journal_data.xml'
--- msf_chart_of_account/data/journal_data.xml 2013-12-16 16:30:03 +0000
+++ msf_chart_of_account/data/journal_data.xml 2014-09-30 15:29:14 +0000
@@ -166,6 +166,7 @@
166 <field name="default_debit_account_id" ref="msf_chart_of_account.3001" />166 <field name="default_debit_account_id" ref="msf_chart_of_account.3001" />
167 <field name="default_credit_account_id" ref="msf_chart_of_account.3001" />167 <field name="default_credit_account_id" ref="msf_chart_of_account.3001" />
168 <field name="analytic_journal_id" ref="cheque_analytic_journal"/>168 <field name="analytic_journal_id" ref="cheque_analytic_journal"/>
169 <field name="bank_journal_id" ref="bank_chf_journal"/>
169 </record>170 </record>
170171
171 <record id="cheque_euro_journal" model="account.journal">172 <record id="cheque_euro_journal" model="account.journal">
@@ -176,6 +177,7 @@
176 <field name="default_debit_account_id" ref="msf_chart_of_account.3001" />177 <field name="default_debit_account_id" ref="msf_chart_of_account.3001" />
177 <field name="default_credit_account_id" ref="msf_chart_of_account.3001" />178 <field name="default_credit_account_id" ref="msf_chart_of_account.3001" />
178 <field name="analytic_journal_id" ref="cheque_analytic_journal"/>179 <field name="analytic_journal_id" ref="cheque_analytic_journal"/>
180 <field name="bank_journal_id" ref="bank_euro_journal"/>
179 </record>181 </record>
180182
181 <record id="account_journal.engagement_journal" model="account.analytic.journal">183 <record id="account_journal.engagement_journal" model="account.analytic.journal">

Subscribers

People subscribed via source and target branches