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

Dear,


in odoo 18 user can edit the log time of workorder but it doesn't edit the related journal entry in accounting app , any work around ?

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

Yes, in Odoo 18, if a user edits the log time of a work order, the related journal entry in the Accounting app does not automatically update

Implement an Automated Adjustment through Python Code 

from odoo import models, api

class MrpWorkorder(models.Model):

    _inherit = 'mrp.workorder'

    def write(self, vals):

        res = super().write(vals)

        if 'duration' in vals:

            self._update_related_account_moves()

        return res

    def _update_related_account_moves(self):

        account_moves = self.env['account.move'].search([

            ('manufacturing_order_id', '=', self.production_id.id)

        ])

        for move in account_moves:

            pass

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
апр. 25
3153
3
июл. 25
3246
2
февр. 25
3793
4
мая 24
4586
1
апр. 24
3314