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

Hi, I have a issue with odoo12 while returning product with BoM setup.

  1. Assuming product relation: Wine Bottle *4 (consumable)= Wine Case (Stockable), with KIT BoM Type.


2. When I create a order with Wine Bottle *4,and finished the delivery order as well.


3. NOW I want to return 2 Bottle Wine and finish the return order.


4. As returned 2 Bottle wine, delivery Qty should be reduced to 2, but the result is 0.00  Showed below.


5. MY Question: IS IT a bug with the BoM. If it is and How to fix it. Thank you.

PS: I have updated the core code from github.

아바타
취소
작성자 베스트 답변

Thanks for your help.

Here is the code to update delivery Qty. Who can help to fix it. Thank you.

    @api.multi
@api.depends('move_ids.state', 'move_ids.scrapped', 'move_ids.product_uom_qty', 'move_ids.product_uom')
def _compute_qty_delivered(self):
super(SaleOrderLine, self)._compute_qty_delivered()

for line in self: # TODO: maybe one day, this should be done in SQL for performance sake
if line.qty_delivered_method == 'stock_move':
qty = 0.0
for move in line.move_ids.filtered(lambda r: r.state == 'done' and not r.scrapped and line.product_id == r.product_id):
if move.location_dest_id.usage == "customer":
if not move.origin_returned_move_id or (move.origin_returned_move_id and move.to_refund):
qty += move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom)
elif move.location_dest_id.usage != "customer" and move.to_refund:
qty -= move.product_uom._compute_quantity(move.product_uom_qty, line.product_uom)
line.qty_delivered = qty
아바타
취소
베스트 답변

The relationship between bottles and case as you mention is 4 bottles = 1. case.

In this relationship, when 4 bottles are ordered 1 case was delivered, there are no bottles. Hence the return is only for case.

With your relationship a case can be directly sold.

If your product is ‘Wine with case’ then the KiT BoM components would need to be 4 bottles and 1 case.

This would create delivery of 4 bottles and 1 case, subsequently bottles and or case can returned.

Not sure if my understanding of your product to sell is accurate.

아바타
취소
베스트 답변

Hi,

Please refer to the module:

1. https://apps.odoo.com/apps/modules/18.0/sale_line_returned_qty_mrp

This module improves how returned quantities are computed on sales order lines when using Kit BOMs.


Hope it helps



아바타
취소
관련 게시물 답글 화면 활동
2
8월 22
6522
2
12월 23
15329
0
10월 23
33
3
10월 23
790
1
10월 23
569