mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] product_cores: to Odoo 15.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'Product Cores',
|
'name': 'Product Cores',
|
||||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||||
'version': '14.0.1.0.0',
|
'version': '15.0.1.0.0',
|
||||||
'category': 'Tools',
|
'category': 'Tools',
|
||||||
'license': 'OPL-1',
|
'license': 'OPL-1',
|
||||||
'summary': 'Charge customers core deposits.',
|
'summary': 'Charge customers core deposits.',
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class PurchaseOrder(models.Model):
|
|||||||
class PurchaseOrderLine(models.Model):
|
class PurchaseOrderLine(models.Model):
|
||||||
_inherit = 'purchase.order.line'
|
_inherit = 'purchase.order.line'
|
||||||
|
|
||||||
|
qty_received = fields.Float(recursive=True)
|
||||||
core_line_id = fields.Many2one('purchase.order.line', string='Core Purchase Line', copy=False)
|
core_line_id = fields.Many2one('purchase.order.line', string='Core Purchase Line', copy=False)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class SaleOrder(models.Model):
|
|||||||
class SaleOrderLine(models.Model):
|
class SaleOrderLine(models.Model):
|
||||||
_inherit = 'sale.order.line'
|
_inherit = 'sale.order.line'
|
||||||
|
|
||||||
|
qty_delivered = fields.Float(recursive=True)
|
||||||
core_line_id = fields.Many2one('sale.order.line', string='Core Sale Line', copy=False)
|
core_line_id = fields.Many2one('sale.order.line', string='Core Sale Line', copy=False)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
@@ -153,22 +153,13 @@ class TestProductCores(common.TransactionCase):
|
|||||||
|
|
||||||
def test_02_sale(self):
|
def test_02_sale(self):
|
||||||
# Need Inventory.
|
# Need Inventory.
|
||||||
adjustment = self.env['stock.inventory'].create({
|
adjust_quant = self.env['stock.quant'].with_context(inventory_mode=True).create({
|
||||||
'name': 'Initial',
|
|
||||||
'product_ids': [(4, self.product.id)],
|
|
||||||
})
|
|
||||||
adjustment.action_start()
|
|
||||||
if not adjustment.line_ids:
|
|
||||||
adjustment_line = self.env['stock.inventory.line'].create({
|
|
||||||
'inventory_id': adjustment.id,
|
|
||||||
'product_id': self.product.id,
|
'product_id': self.product.id,
|
||||||
|
'inventory_quantity': 20.0,
|
||||||
'location_id': self.env.ref('stock.warehouse0').lot_stock_id.id,
|
'location_id': self.env.ref('stock.warehouse0').lot_stock_id.id,
|
||||||
})
|
})
|
||||||
adjustment.line_ids.write({
|
adjust_quant.action_apply_inventory()
|
||||||
# Maybe add Serial.
|
self.assertEqual(self.product.virtual_available, 20.0)
|
||||||
'product_qty': 20.0,
|
|
||||||
})
|
|
||||||
adjustment.action_validate()
|
|
||||||
|
|
||||||
sale = self.env['sale.order'].create({
|
sale = self.env['sale.order'].create({
|
||||||
'partner_id': self.customer.id,
|
'partner_id': self.customer.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user