-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:DLUT-SIE/ERP into dev
- Loading branch information
Showing
8 changed files
with
148 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
from django.apps import AppConfig | ||
from django.db.models.signals import post_save | ||
|
||
|
||
class ProcessConfig(AppConfig): | ||
name = 'Process' | ||
|
||
def ready(self): | ||
from Process import signals | ||
post_save.connect(signals.init_process, | ||
sender='Core.WorkOrder') |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2018-01-18 06:56 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('Process', '0020_auto_20171230_1441'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='quotalist', | ||
name='status', | ||
field=models.IntegerField(choices=[(0, '待编制'), (1, '待审核'), (2, '已生成采购物料')], default=0, verbose_name='定额明细表编制状态'), | ||
), | ||
] |
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,21 @@ | ||
from django.db import transaction | ||
|
||
from Process import QUOTA_LIST_CATEGORY_USING | ||
from Process.models import QuotaList, ProcessLibrary | ||
|
||
|
||
def init_process(*args, **kwargs): | ||
""" | ||
监听工作令的创建,当工作令创建完成后,建立相应的工艺库和所有的定额表 | ||
""" | ||
if not kwargs['created']: | ||
return | ||
work_order = kwargs['instance'] | ||
with transaction.atomic(): | ||
quota_lists = [] | ||
process_library = ProcessLibrary.objects.create(work_order=work_order) | ||
for item in QUOTA_LIST_CATEGORY_USING: | ||
quota_list = QuotaList(lib=process_library, | ||
category=item) | ||
quota_lists.append(quota_list) | ||
QuotaList.objects.bulk_create(quota_lists) |
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