I am trying to fetch all stock locations which are under a specific warehouse in Odoo 15.
I tried the below code.
locations_dd.append(self.env['stock.location'].search([('warehouse_id','=',i)]).ids)
But I am getting the below error:
ERROR odoo15ee odoo.osv.expression: Non-stored field stock.location.warehouse_id cannot be searched.
How can I solve this?
warehouse_id is a non-stored computed field, you can't use it in the search domain.
You can use the stock location location_id field (which is the parent location) and the warehouse view location field (view_location_id) to get all warehouse locations.
Example:
location_ids = self.env['stock.location'].search([('location_id', 'child_of', warehouse_id.view_location_id.id)])
Related
I am creating a wizard on stock updation . But for updating a product, i am giving a many2one field where product.product can be added,a many2one field where stock location can be added and the after that, another many2one field to add lot.
When i select a location from stock location, i want to set only the lots which comes under that specified product and in that location in the lot field.
How can i set my domain of lot id like this?
firstly, when i looked at the stock.production.lot model,it doesn't have any stock.location field connected with it. But, the lots which are created in stock.production.lot are connected to WH/Stock location. But i can create lots in other location through stock.quant.
I read the code, but couldn't find anything connecting stock.location and stock.production.lot.
When i am updating/creating a lot in stock.quant,the lots are shown on the basis of stock location onchange.
If I create a new field on a model, making it a calculated or related field, and set the store parameter to be true. When I look on the sql server using pg admin, on the table itself, i can't fiend the field. I think this would be logic if the data entered wouldn't be stored, but calculated each time it was shown on a view (from, tree, ...).
Example in the POS orderline the field tax_ids is a calculated / related field. The tax_id is stored, because if I change the id on product level, it doesn't affect the order line, when consulting it after changing the tax id. So this data is stored. But when I try to find the field in the pos_order_line model on the sql server it doesn't show on the pos orderline. In odoo, settings models, it does show on the pos_order_line model. So where does odoo store the data?
We use Sharepoint Foundation 2010 and we have 2 Lists in a site. Those are:
Customers List.
Sale Invoices List.
Customers List has Title field as Unique & Indexed Column.
Sale Invoices List has a lookup column (i.e., Customer) from the Customers List (Title).
My issue is:
Customers List has just crossed 5000 items. When I try to add a List Item in Sale Invoices List (where I have Lookup Column from Customers List), it throws an error as given below:
Error Message:- This is a lookup column that displays data from another list that currently exceeds the List View Threshold defined by the administrator (5000). To add items to the current list, please ask the list owner to remove this column.
I have increased temporarily the List View Threshold Limit to 6000 Items. It’s working fine now.
Is there any solution to fix the issue without increasing the List Items Threshold Limit?
Thanks in Advance.
You should look into archiving list items. Another thing you can think about doing is creating different lists for different time periods so that you can avoid this List View Threshold and your list queries can be as fast as possible.
Check this out: http://referpages.com/wp/2012/04/101/
Using OpenERP 7
I have a client that needs to see the supplier name (Just one if there are multiple suppliers) in the product listing. I've tried using related fields but can't seem to get the syntax right. Can anyone help me on this?
Its not possible to define related field to one2many, in the product object have one2many product.supplierinfo object, so if you want to get only one supplier name then define a function field to get supplier name
how can I add a listview with the stock locations of the product in product form view. Or maybe somebody knows a function that returns the stock location ids of an given product?
Thank you.
In openerp no such king of function to give ids of product location.
But in openerp function to get how much product available in this location.
If want to get location ids of give product then you have to make your own functions.