forked from erp-dev/erp
feat: stock module
This commit is contained in:
18
basic_info/migrations/0016_product_unit.py
Normal file
18
basic_info/migrations/0016_product_unit.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-04 02:12
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basic_info', '0015_remove_product_single_price_product_single_price_in_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='unit',
|
||||
field=models.IntegerField(choices=[(1, '米'), (2, '码'), (3, '公斤')], default=1, verbose_name='单位'),
|
||||
),
|
||||
]
|
||||
18
basic_info/migrations/0017_product_image.py
Normal file
18
basic_info/migrations/0017_product_image.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-04 05:07
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basic_info', '0016_product_unit'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='image',
|
||||
field=models.ImageField(blank=True, null=True, upload_to='product_images/', verbose_name='产品图片'),
|
||||
),
|
||||
]
|
||||
@@ -117,8 +117,19 @@ class Product(ModelBase):
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
unit = models.IntegerField(
|
||||
choices=ProductUnitEnum.choices,
|
||||
default=ProductUnitEnum.METER,
|
||||
verbose_name='单位',
|
||||
)
|
||||
spec = models.CharField(max_length=100, blank=True, null=True, verbose_name='规格')
|
||||
description = models.TextField(blank=True, null=True, verbose_name='备注描述')
|
||||
image = models.ImageField(
|
||||
upload_to='product_images/',
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name='产品图片',
|
||||
)
|
||||
transform_rate = models.DecimalField(
|
||||
max_digits=10,
|
||||
decimal_places=4,
|
||||
|
||||
Reference in New Issue
Block a user