-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX]l10n_it_delivery_note_batch: hide
Create DNs
button when all p…
…ickings have delivery note
- Loading branch information
1 parent
4d2caca
commit 330c9a3
Showing
7 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_delivery_note_batch |
43 changes: 43 additions & 0 deletions
43
l10n_it_delivery_note_batch/tests/test_delivery_note_batch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestDeliveryNoteBatch(TransactionCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
|
||
cls.StockDeliveryNote = cls.env["stock.delivery.note"] | ||
cls.SaleOrder = cls.env["sale.order"] | ||
cls.SaleOrderLine = cls.env["sale.order.line"] | ||
cls.StockPickingBatch = cls.env["stock.picking.batch"] | ||
|
||
cls.partner = cls.env.ref("base.res_partner_address_15") | ||
cls.product = cls.env.ref( | ||
"sale_product_configurator.product_product_1_product_template" | ||
) | ||
|
||
def generate_stock_picking(self): | ||
sale_order = self.SaleOrder.create( | ||
{ | ||
"partner_id": self.partner.id, | ||
"order_line": [(0, 0, {"product_id": self.product.id})], | ||
} | ||
) | ||
sale_order.action_confirm() | ||
return sale_order.picking_ids | ||
|
||
def test_ao(self): | ||
picking_1 = self.generate_stock_picking() | ||
picking_2 = self.generate_stock_picking() | ||
pickings = picking_1 + picking_2 | ||
|
||
stock_picking_batch = self.StockPickingBatch.create( | ||
{ | ||
"user_id": self.env.ref("base.user_demo").id, | ||
"picking_ids": [(6, 0, pickings.ids)], | ||
} | ||
) | ||
self.assertFalse(stock_picking_batch.all_pickings_have_delivery_note) | ||
stock_picking_batch.create_delivery_notes() | ||
stock_picking_batch._compute_all_pickings_have_delivery_note() | ||
self.assertTrue(stock_picking_batch.all_pickings_have_delivery_note) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters