Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
14926 Представления

Hello,


I have 2 models which is shown below with fields.


Class ProductHistory(models.Model):

     _name = 'product.history'

    product_history_ids = fields.One2many('product.history.details', 'history_id', string='Product History', track_visibility='onchange')


Class ProductHistoryDetails(models.Model):

     _name = 'product.history.details'

     history_id = fields.Many2one('product.history', 'History', track_visibility='onchange')

     product_id = fields.Many2one('product.product', 'Product', track_visibility='onchange')

     price = fields.Float('Price', track_visibility='onchange')


Now, If i am changing price in the one2many fields, create log for that.

How to do it ?


Any suggestion will be Appreciated.

Thanks,

Аватар
Отменить

Did you get the answer?

Автор

No. I didn't get any answer

Лучший ответ

Hi, 
Check out this module https://www.odoo.com/apps/modules/8.0/message_post_model/
I used it in a project and works very well for me. You need to customize it to suit perfectly your need.

Upvote if this helps.
Thank you.

Аватар
Отменить
Автор

From this module, can't generate log for One2many field.

the module let's you track your O2M changes. You need to configure it as shown in the link.

Автор

I configure it as shown in the link, but didn't effect or didn't generate log if I changed in O2M field

Check if your O2M field appears in excluded fields. It must not be if you want it to be tracked..

by the way, the module is basically for V8.

Автор

Install that module.

Added tracking in custom models.

Add O2M fields in Excluded fields. (O2M field is appeared)

Add O2M's fields which i want to track in Exclude External fields.

When I changed value in O2M's fields which i define in Exclude External fields, didn't generate log for that.

You must not add the field to the Excluded fields ...

In Excluded fields, you only add the fields that you don't want to track.

Related Posts Ответы Просмотры Активность
6
июн. 16
4300
1
июл. 17
4369
1
окт. 16
11397
1
янв. 16
14277
0
нояб. 21
3393