change price type int -> decimal field
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.2.4 on 2025-11-07 12:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('wherehouse', '0019_stockmovemend_sender'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='inventory',
|
||||
name='price',
|
||||
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=15),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='inventory',
|
||||
name='unit_price',
|
||||
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=15),
|
||||
),
|
||||
]
|
||||
@@ -17,7 +17,7 @@ class Inventory(BaseModel):
|
||||
quantity = models.PositiveIntegerField(default=0)
|
||||
product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name='inventories')
|
||||
unity = models.ForeignKey(Unity, on_delete=models.SET_NULL, related_name='inventories', null=True)
|
||||
price = models.PositiveBigIntegerField(default=0)
|
||||
price = models.DecimalField(max_digits=15, decimal_places=2, default=0.00)
|
||||
project_folder = models.ForeignKey(
|
||||
ProjectFolder, on_delete=models.SET_NULL, null=True, blank=True,
|
||||
related_name='inventories'
|
||||
@@ -27,7 +27,7 @@ class Inventory(BaseModel):
|
||||
related_name='inventories'
|
||||
)
|
||||
is_invalid = models.BooleanField(default=False)
|
||||
unit_price = models.PositiveBigIntegerField(default=0)
|
||||
unit_price = models.DecimalField(max_digits=15, decimal_places=2, default=0.00)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.product} in {self.wherehouse}'
|
||||
|
||||
Reference in New Issue
Block a user