The thing I like most about your vids is - you do not only show and explain the solution for a problem - nope, man. You are giving the way how to resolve it yourself next time - this is the real power of these tutorials.
sorry my english is too bad The little bit I know about odoo is because of you, thanks This solution is ok when you insert a record, but if you update a record and don't change partner_id, the onchange dont triggered and you update the order_id with any arbitrary record in table 'sale.order', I do not find any solutions for this issue
thank you for this nice tutorial. I would like to know how to do this on Odoo studio: I mean in the domain field, I would like to show only the vendor related product in the PO , or the customer re;ated product in an SO. can you please tell us how?
Great Job! Thanks a lot for your video(s). I am looking for an explanation from a pro, so eventually you could help: using STUDIO in Odoo v14, I created a field "gender" (as a selection-field with the values 'M', 'F', 'D' ) in the contacts module. I also created a field "salutation" in contacts. What I want Odoo to do is to write the correct salutation into the salutation field when the user chooses the appropiate "gender"-field-option M ,F or D. How should I program the salutation field?
I have a problem, the field is always showing more data that a i need. I have to show a res.partner list i did everything and the field show at first the list that i have plus the rest of res.partner, hope can help me. Thanks for the videos are very useful.
@@OdooMates return {'domain':{'representatives': [('id', 'in', representatives)]}}. "representatives" is a list with all the id's that i need to search
@@OdooMates Yes, that's the weird thing. For more context, I have a form that contains a many2many(many2many tags) field to res.partner, a have a button that pop up a wizard this wizard contains a field called "representatives" in this field i want to show the list of res.partner selected in the many2many tags in the form. If I had, for example, a list of res.partner like (John, Walter, Steve, Myke) and in my many2many tags i choose only (Steve, Walter) the wizard is showing up at first (John, Walter) in the first place but after that is showing (John, Myke). I'm looking that the field "representatives" only shows (Steve, Walter).
Thank you for the video Odoo Mates... Our company just move to Odoo SH (v14) and my team is not accepting warning messages in the automatic test. I do my dynamic domains the way you showed in this video but even though it works in Odoo 14, a deprecation warning is shown: "onchange method the_model.onchange_function returned a domain, this is deprecated". Any advice on how to create dynamic domains in Odoo 14?
If you confirm the appointment, and the edit it again and you go directly to the sale_order field you'll get all the sales even if the partner field is already specified :/
@@OdooMates 8:25 A list of "Sale Order" documents is displayed. And you can choose only one. And if the payment will be several times and different Invoice? Then you need to specify several Invoice and the amount for each that goes to this "Sale Order"
@@OdooMates what I mean, we add 2 fields: - partner_id = fields.Many2one("res.partner", string="Partner") - address_id = fields.Many2one("res.partner", string="Address") is it possible to return the same many2one with different values? one is partner name, the other one is address? or is there any alternative solution about it?
@@OdooMates Agreed. but how to return different values for the same Many2one for above scenario? such as partner name and address name, but using the same comodel name, that is res.partner?
if you activate developer mode and navigate go to Settings -> Technical -> Database Structure -> Models, search for the models and open it, then you can see all the fields/columns in the table/model
Hello. Thank you for the video. Could you help me please again? ;) I'm trying to return domain in onchange function, but it doesn't work. The error message is: onchange method ProductManufacturer.get_selected_manufacturer returned a domain, this is deprecated. Odoo 14. What can I do with this?
The method shown in this video is deprecated in odoo14, from odoo14 you can use this method shown in this video: ruclips.net/video/dq5Vtj_pwuI/видео.html
No other options is available i think, this is the common practice i have seen. Not sure, anyway you can try some other ways if you it might work out and explore it (y)
@@OdooMates for eg, if not choosing customer, respective value should be open Or we choose customer, all sale order value wants to open, Is it possible?
@@rajeshkumarcbm Yes, this can be done inside the function, check whether there is value given in partner field or not and return domain accordingly using a if condition
Using the studio, you can trigger an onchange using the automated action and return the domain for the other field from there. See how to trigger onchange from UI from here: ruclips.net/video/psQF5jOrd48/видео.html
Hello i'm having this error "TypeError: unhashable type: 'list'" and this is what i am returning return {'domain':{'commune': [('state_id', 'in ', rec.wilaya.mapped('id'))]}} (wilaya is a may2many field)
The thing I like most about your vids is - you do not only show and explain the solution for a problem - nope, man.
You are giving the way how to resolve it yourself next time - this is the real power of these tutorials.
thanks for the lovely words 😘🤩😍🥰 and thanks for all your supports
Dude, I just love you!!! Thank you. I couldn't figured it out by my self.
happy that it helped
sorry my english is too bad
The little bit I know about odoo is because of you, thanks
This solution is ok when you insert a record, but if you update a record and don't change partner_id, the onchange dont triggered and you update the order_id with any arbitrary record in table 'sale.order', I do not find any solutions for this issue
Use this method: ruclips.net/video/dq5Vtj_pwuI/видео.html
thank you for this nice tutorial. I would like to know how to do this on Odoo studio: I mean in the domain field, I would like to show only the vendor related product in the PO , or the customer re;ated product in an SO. can you please tell us how?
Can we do the same scenario using domain filter in xml level ?
Great as you are doing always :-)
would you like which IDE you are using for developing. As well made short video for that IDE if possible
We use Pycharm and we already have made a video if it. See: ruclips.net/video/p7SJW36lqVE/видео.html
Great Job! Thanks a lot for your video(s).
I am looking for an explanation from a pro, so eventually you could help:
using STUDIO in Odoo v14, I created a field "gender" (as a selection-field with the values 'M', 'F', 'D' ) in the contacts module. I also created a field "salutation" in contacts.
What I want Odoo to do is to write the correct salutation into the salutation field when the user chooses the appropiate "gender"-field-option M ,F or D.
How should I program the salutation field?
so you need to write onchange from studio right? see this: ruclips.net/video/psQF5jOrd48/видео.html
Can we make report in both type (excel,Pdf) from wizard? if yes then how to set domain for date from to date to for PDF report
yes possible,see: ruclips.net/video/u7frpEWdrNc/видео.html
I have a problem, the field is always showing more data that a i need. I have to show a res.partner list i did everything and the field show at first the list that i have plus the rest of res.partner, hope can help me. Thanks for the videos are very useful.
can i see the domain you have applied ?
@@OdooMates return {'domain':{'representatives': [('id', 'in', representatives)]}}. "representatives" is a list with all the id's that i need to search
@@sendermolina2321 is the function returning this domain getting executed ?
@@OdooMates Yes, that's the weird thing. For more context, I have a form that contains a many2many(many2many tags) field to res.partner, a have a button that pop up a wizard this wizard contains a field called "representatives" in this field i want to show the list of res.partner selected in the many2many tags in the form.
If I had, for example, a list of res.partner like (John, Walter, Steve, Myke) and in my many2many tags i choose only (Steve, Walter) the wizard is showing up at first (John, Walter) in the first place but after that is showing (John, Myke). I'm looking that the field "representatives" only shows (Steve, Walter).
how we can do same thing only show the particular One2many field ids of another model in Many2One field
You can directly give domain or from onchange function
Thanks alot champ....Awesome
Welcome brother :)
Thank you for the video Odoo Mates... Our company just move to Odoo SH (v14) and my team is not accepting warning messages in the automatic test. I do my dynamic domains the way you showed in this video but even though it works in Odoo 14, a deprecation warning is shown: "onchange method the_model.onchange_function returned a domain, this is deprecated". Any advice on how to create dynamic domains in Odoo 14?
I solve this with an auxiliary computed field filled with the domain I needed
Solution For odoo 14: ruclips.net/video/dq5Vtj_pwuI/видео.html
@@hectorstivalet it this method? ruclips.net/video/dq5Vtj_pwuI/видео.html
@@OdooMates Yes Mate. I didn't use that addon module but yes, I did the same thing. Just a comment on your code: @api.multi is not necessary in v14.
Amazing Video .....
This solution is deprecated on Odoo 14, do you know how to accomplish this on Odoo 14? Thanks!
if you check the rst file you will understand how to use this module, we will be making a video soon about this module.
For Odoo14: See this Video: ruclips.net/video/dq5Vtj_pwuI/видео.html
If you confirm the appointment, and the edit it again and you go directly to the sale_order field you'll get all the sales even if the partner field is already specified :/
Solution: ruclips.net/video/dq5Vtj_pwuI/видео.html
very nice nd informated video...sir how we are call field from another module?
Related field will help ? ruclips.net/video/rLlUQ9GAan8/видео.html
What will happen in the "Sale order" if the "Customer" pays for the service with two or three documents?
Documents means ? Invoice ?
@@OdooMates 8:25 A list of "Sale Order" documents is displayed. And you can choose only one. And if the payment will be several times and different Invoice?
Then you need to specify several Invoice and the amount for each that goes to this "Sale Order"
@@obehobeh9984 confirm all the sales, create invoice for all. Make a payment as whole and reconcile with the invoice
The domain will no more work if you refresh the page. Can you please help how we can resolve this issue?
the solution : fields.many2many(...., domain="[('partner_id','=', partner_id)]", ...) # base on AccountMoveLine.product_uom_id definition
How to create custom fields product and qty, selected product update same product qty please tell me
How we can do same thing in wizard customer field in that place where it is and sale order field in wizard then how we can do that please
How to return value for specific fields of m2o (like payment terms), not order ID?
May i know what issue you face with this method
@@OdooMates what I mean, we add 2 fields:
- partner_id = fields.Many2one("res.partner", string="Partner")
- address_id = fields.Many2one("res.partner", string="Address")
is it possible to return the same many2one with different values? one is partner name, the other one is address? or is there any alternative solution about it?
@@decajohn6786 there is no issue for adding multiple fields with same co-model in same model
@@OdooMates Agreed. but how to return different values for the same Many2one for above scenario? such as partner name and address name, but using the same comodel name, that is res.partner?
@@decajohn6786 return {'domain': {'field_1': [('type', '=', 'individual')],
'field_2': [('type', '=', 'company')]}}
How can we do this if I have 2 fields .
eg: i need to get result in Filed C based on Field A and Field B
use the same logic, write common onchange function for both fields A and B, and then return domain of field C from it
See: ruclips.net/video/dq5Vtj_pwuI/видео.html
Thanks :)
welcome :)
thanks for this interesting video,
How to return domain for an one2many field using web domain module?
Did you tried the same way for o2m field and not succeeded ?
what are the columns in the odoo AccountType master , documentType master and how these are accessed in a code ?
if you activate developer mode and navigate go to Settings -> Technical -> Database Structure -> Models, search for the models and open it, then you can see all the fields/columns in the table/model
Hello. Thank you for the video. Could you help me please again? ;) I'm trying to return domain in onchange function, but it doesn't work. The error message is: onchange method ProductManufacturer.get_selected_manufacturer returned a domain, this is deprecated. Odoo 14. What can I do with this?
The method shown in this video is deprecated in odoo14, from odoo14 you can use this method shown in this video: ruclips.net/video/dq5Vtj_pwuI/видео.html
See: ruclips.net/video/dq5Vtj_pwuI/видео.html
@@OdooMates Thank you, but the module does not load for Odoo 14 :\
Which module ?
@@Антон-е7щ4н understood, please download it from github: github.com/OCA/web/tree/14.0
Hi bro, without onchange & compute function can we write domain like this?
No other options is available i think, this is the common practice i have seen. Not sure, anyway you can try some other ways if you it might work out and explore it (y)
@@OdooMates for eg,
if not choosing customer, respective value should be open
Or we choose customer, all sale order value wants to open,
Is it possible?
@@rajeshkumarcbm Yes, this can be done inside the function, check whether there is value given in partner field or not and return domain accordingly using a if condition
@@OdooMates thnx bro let me check.
How we can do the same using odoo studio?
you can write an onchange using the automated action and return the domain from there
ruclips.net/video/psQF5jOrd48/видео.html
@@OdooMates have any example how can i give Domain For A Field Based On Another Field with odoo studio?
In v11 I didn't need to use "rec" variable, since there is only one instance in "self".
you cannot assure it. this will depends on the scenario and it is same in all odoo versions :)
@@OdooMates you mean by scenarios, when a user attempt to multi-select or single-select records, right?
👍👍
thanks :)
how to give domain to product inside one2many field?
inside one2many model, when we define product field, you can give the domain in python level or in the xml along with product field
@@OdooMates
i had a problem in that!
@api.onchange('category_id')
def _onchange_category_id(self):
print('hi....................', self.category_id)
products = []
if self.category_id:
products = self.env['product.product'].search([('categ_id', '=', self.category_id.id)]).ids
print('list....................', products)
return {'domain': {'farm_materials_oline.product_id': [
('id', 'in', products)
]}}
👍🏻
How To Give Domain For A Field Based On Another Field with odoo studio?
Using the studio, you can trigger an onchange using the automated action and return the domain for the other field from there. See how to trigger onchange from UI from here: ruclips.net/video/psQF5jOrd48/видео.html
Hello i'm having this error "TypeError: unhashable type: 'list'" and this is what i am returning
return {'domain':{'commune': [('state_id', 'in ', rec.wilaya.mapped('id'))]}} (wilaya is a may2many field)
try: {'domain':{'commune': [('state_id', 'in ', rec.wilaya.ids)]}}