Skip to content

Commit

Permalink
[MIG] purchase_sale_stock_inter_company: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongnmtm committed Mar 28, 2024
1 parent 9143cd1 commit 7db17e9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions purchase_sale_stock_inter_company/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ Contributors

- Maksym Yankin <[email protected]>

- \`Komit <https://komit-consulting.com>\`:

- Cuong Nguyen Mtm <[email protected]>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion purchase_sale_stock_inter_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Inter Company Module for Purchase to Sale Order with warehouse",
"summary": "Intercompany PO/SO rules with warehouse",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Purchase Management",
"website": "https://github.com/OCA/multi-company",
"author": "Odoo SA, Akretion, Tecnativa, Odoo Community Association (OCA)",
Expand Down
14 changes: 4 additions & 10 deletions purchase_sale_stock_inter_company/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@ def _action_done(self):
continue
purchase.picking_ids.write({"intercompany_picking_id": pick.id})
for move_line in pick.move_line_ids:
qty_done = move_line.qty_done
quantity = move_line.quantity
sale_line_id = move_line.move_id.sale_line_id
po_move_lines = sale_line_id.auto_purchase_line_id.move_ids.mapped(
"move_line_ids"
)
for po_move_line in po_move_lines:
if po_move_line.reserved_qty >= qty_done:
po_move_line.qty_done = qty_done
qty_done = 0.0
else:
po_move_line.qty_done = po_move_line.reserved_qty
qty_done -= po_move_line.reserved_qty
po_move_line.quantity = quantity
quantity = 0.0
po_picks |= po_move_line.picking_id
if qty_done and po_move_lines:
po_move_lines[-1:].qty_done += qty_done
elif not po_move_lines:
if not po_move_lines:
raise UserError(
_(
"There's no corresponding line in PO %(po)s for assigning "
Expand Down
2 changes: 2 additions & 0 deletions purchase_sale_stock_inter_company/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
- Pedro M. Baeza
- \`Camptocamp \<<https://www.camptocamp.com>\>\`:
- Maksym Yankin \<<[email protected]>\>
- \`Komit \<<https://komit-consulting.com>\>\`:
- Cuong Nguyen Mtm \<<[email protected]>\>
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Maksym Yankin &lt;<a class="reference external" href="mailto:maksym.yankin&#64;camptocamp.com">maksym.yankin&#64;camptocamp.com</a>&gt;</li>
</ul>
</li>
<li>`Komit &lt;<a class="reference external" href="https://komit-consulting.com">https://komit-consulting.com</a>&gt;`:<ul>
<li>Cuong Nguyen Mtm &lt;<a class="reference external" href="mailto:cuong.nmtm&#64;komit-consulting.com">cuong.nmtm&#64;komit-consulting.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<label for="warehouse_id" class="o_light_label" />
<field
name="warehouse_id"
attrs="{'required': [('so_from_po', '=', True)]}"
required="so_from_po"
class="oe_inline"
domain="[('company_id', '=', company_id)]"
/>
Expand Down

0 comments on commit 7db17e9

Please sign in to comment.