Override default field mappings Ex: Delivery Note -> Sales Invoice

34 views
Skip to first unread message

Jev Björsell

unread,
Jul 19, 2014, 6:04:22 PM7/19/14
to erpnext-dev...@googlegroups.com
Hi All,


What's the best practice in V4 to customize field mappings between Doctype transitions?

My use case is as follows;

A shipment is made in 1 Jan, a Delivery Note is created with Posting Date of Jan 1.
On the 3rd of Jan, billing is processed. ERP Billing user goes to the Delivery Note and runs the "Make Invoice" action.
System produces a new Sales Invoice with Posting Date set to 3rd of January. I want the Posting Date to be mapped from the Delivery Note, Sales Invoice Posting Date should be 1 Jan.



Thanks!
-Jev

Rushabh Mehta

unread,
Jul 21, 2014, 1:18:51 AM7/21/14
to erpnext-dev...@googlegroups.com
On 20-Jul-2014, at 3:34 am, Jev Björsell <ebjo...@gmail.com> wrote:

A shipment is made in 1 Jan, a Delivery Note is created with Posting Date of Jan 1.
On the 3rd of Jan, billing is processed. ERP Billing user goes to the Delivery Note and runs the "Make Invoice" action.
System produces a new Sales Invoice with Posting Date set to 3rd of January. I want the Posting Date to be mapped from the Delivery Note, Sales Invoice Posting Date should be 1 Jan.

There are no hooks around mappings right now. One temp solution would be to make a "Draft" invoice on the day of shipment and submit it later.

There could be a hook here though:


`target_doc.run_method('after_mapping', source_doc)`

Then add a hook in `doc_events`

You want to add this / test it and send a PR ?




Thanks!
-Jev

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/99f75a14-a98a-4f92-a11f-e496a8deb905%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jev Björsell

unread,
Jul 21, 2014, 10:44:50 AM7/21/14
to erpnext-dev...@googlegroups.com
I will try find time to add that hook. :)


You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/hugGQNPApXY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/70217D9D-223C-422F-B5BA-EFD8121B459A%40gmail.com.
Reply all
Reply to author
Forward
0 new messages