Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to transfer data from move_lines in stock.picking to invoice_line when clicking on 'Create Invoice'?

By
Sayed Anisul Hoque
on 9/13/15, 1:04 PM 490 views

Hi

I want to move the field date_expected from stock.picking -> move_lines to account.invoice.line -> delivery_date (custom). I have created the delivery_date field in invoice_line. Now while generating invoice from stock.picking then along with all the other data date_expected will be also copied into the delivery_date.


Please help in this regards

A bit unclear. Could you pls feed us with how do you generate the invoice, I prefer posting the code you've written along with the supposed result, and the currently unexpected result so one can help

Tarek Mohamed Ibrahim
on 9/13/15, 11:59 PM
0
Sayed Anisul Hoque
On 9/14/15, 12:39 AM

********************** EDIT ****************************

 Please check the link for the way I solved

http://stackoverflow.com/questions/26715665/how-to-add-a-value-to-invoice-from-addons-stock-account-stock-py-in-odoo/32568579#32568579

**********************************************************


1. I have declared my custom date in invoice for each invoice line. Code is as below.

class invoice_line(osv.osv):

_name = 'account.invoice.line'

_inherit = 'account.invoice.line'

_columns = {

'x_delivery_date' : fields.datetime(string="Delivery Date")

}

2. in Warehouse for each move_lines of the id there is a variable - date_expected (Expected Date). Suppose for a particular move I want to generate invoice by clicking Create Invoice so, when user clicks on create invoice then some of the move data transfers from stock.picking to account.invoice. I want the date_expected field data to be transferred as well into the x_delivery_date field.

I am stuck up in point 2.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/13/15, 1:04 PM
Seen: 490 times
Last updated: 9/14/15, 11:35 AM