Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3251 Представления

Hello house,

I have a many2many field on res.partner relating to product.template.

On the partner form page, a list of products has been selected for the partner.

My case is that when, when a quotation is been raised and any of the product in the selected list is been selected on sales order line, a warning message should show.

Please how can I achieve it on Odoo 10

Аватар
Отменить
Лучший ответ

Hi Sputy,

You do like:

# first get partneron sale order

partner = self.partner_id


# loop to check any product in sale line is exist in partner form or not if, then raise warning

for line in self.order_line:

    for product_tmpl in partner.PRODUCT_TEMPLATE_MANY2MANY_FIELD:

        if product_tmpl.id == line.product_id.product_tmp_id.id:

            # Here you can set warning whatever you want


* PRODUCT_TEMPLATE_MANY2MANY_FIELD (many2many field that you have taken in partner form)

Accept and upvote answer if helpful

Thanks and regards

Haresh Kansara

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
нояб. 24
19092
1
сент. 23
2019
3
мая 23
4823
7
апр. 23
48058
1
дек. 22
6993