콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1233 화면

How can we set back, after an upgrade in Purchase app. Before the update of the app. When there is a Purchase Orders, and a department needs to validate it, so the demand and quantity is default to 0. And this department is the one who will set the quantity delivered.

We have a 20+ and more items purchase orders in one vendor, and they deliver the items partially. 

Now, the new update of Purchase app. The demand and quantity, is automatically same value to every items purchase orders. So we need to change the other items that haven't delivered yet to 0. This gives us a hassle and confusing to the datas. 

아바타
취소

Did you fix the issue?

베스트 답변

Hi,

Please refer to the code below:


from odoo import models


class PurchaseOrder(models.Model):

    _inherit = 'purchase.order'


    def button_confirm(self):

        res = super().button_confirm()

        for order in self:

            for picking in order.picking_ids:

                for move in picking.move_ids_without_package:

                    move.quantity = 0.0

        return res


Hope it helps.

아바타
취소
관련 게시물 답글 화면 활동
3
7월 25
1859
1
6월 25
1987
2
5월 25
1846
1
5월 25
1113
1
2월 25
38