İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
6509 Görünümler

Hi, i am using odoo11. I activated the lot traceability.

I create a purchase order and click on "receive products", so I end up in the following page:


By clicking on the menu icon (the one the red arrow is pointing to), a pop-up opens where the user can enters the various details including the "done" quantity and the lot name:



Now, what I really wanted to do is to make so that the lot number is automatically generated (in a given format) and set in the circled area.

I wrote the python code that generates the lot, and it works (actually my code generates the new lot when I validate the purchase order, so when i get here the lot already exists). My problem is to set the lot value in the circled field. (let apart the fact that odoo differentiates between lot_name and lot_number, which added a bit of perplexity in my already confused mind... but i'll think of it later)

So i investigated looking at the views, trying to understand where to put my hands.

The view corresponding to my second image is "stock.move.operations.form", and the code that defines the move lines is the following:

<field name="move_line_ids" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'tree_view_ref': 'stock.view_stock_move_line_operation_tree', 'default_product_uom_id': product_uom, 'default_picking_id': picking_id, 'default_move_id': id, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}"/>
Essentially, if i'm not wrong, the "move_line_ids" is automatically interpreted as a reference to the stock.move.line model and a corresponding tree-view is loaded: the problem is that i cannot find this view in the source code. 

Am I missing something?
The view_move_line_tree view in the stock_move_line_views appears to be unrelated to what appears in the page.

Thank you in advance for any help.


Avatar
Vazgeç
Üretici En İyi Yanıt

I found it!

view_stock_move_line_operation_tree

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eyl 23
8118
1
May 19
6399
3
Eki 18
19567
4
Ara 23
13440
3
Oca 20
7027