Code Monkey home page Code Monkey logo

django-bom's People

Contributors

arminsch avatar dependabot[bot] avatar jas-chimni avatar lcesero avatar mpkasp avatar princess-fixturfab avatar squio avatar titousensei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-bom's Issues

Edit Part Class: unable to save

When editing a part class the form refuses to save when the part code is unchanged.

Test: edit part with code '200'
Change name or comment field, leave code untouched.

Expected: part is saved with updated name / comment

Actual result:
Field code is marked with error 'Part class with code 200 is already defined.'

Part number syntax

From ziogianni on the indabom repository issues:

Hello everyone, I'm looking for a way to modify the part number syntax in order to better customize this platform to my needs. Take into account that every business has its own way to code parts, so I suppose that it'd be useful to provide a config file where you can decide your own part number syntax, going beyond the predefined structure which mainly fits to the electronics scope.

Part Temperature Range

The part temperature setting is currently a single "temperature" value, but most parts I work with have a temperature range (0-45C), (-25-75C) etc. Being able to specify a range would be useful.

Exported cost doesn't account for DNL components

Another potential bug. We are using IndaBom for production configuration like a traditional PLM would be used for. However when I look at the cost of the different configurations, I don't see the price difference that I expect. Long story short, even if I have a component labeled as a do not load, it still shows in the cost of the board on the report. I believe the code needs to look at the do_not_load field to determine if the cost or the part(s) should count against the sub-assembly price. I hope I explained it well and if not let me know and I'll explain and/or show screen of what I'm seeing.

I exported the BOM to a cab and if I take out the DNL cost it seems to be correct.

Sellers informations should be revision dependent

I'm not sure I'm using django-bom the way it has been imagined, so maybe this is not an issue, but more a feature request.

When I create a BOM, I want to add sub-parts with price. This allows to have a good view of my product costs. When I send the device into production, I want to release the revision (say revision 1), and create a new one (revision 2) to prepare the next production.

Even if there's no changes on the BOM regarding the part list, the parts prices will likely changes. If I adjust the parts prices in this new revision, the overall price as well as each part of the revision 1 will be impacted by the new prices.

To summarize the problem, the manufacturer parts and the sellers parts should be dependent of the part revision, and not the part (on a database point of view). This will allows to get statistics of price evolution from one revision (in my case, revision = production run).

Once a part is released, all its attributes (including the sellers data) should be freezed I think. This is currently not the case.

Before working on these changes, I think a discussion about this feature and its impacts is needed. Also, this is maybe not in the implementation philosophy and thus this feature should be rejected.

Initial migration fails on "table bom_distributorpart does not exist"

Hello! I'm new to the project but hoping to use it for my business.

I've hit an issue with the initial install after following the instructions in #3 , I get the following error:

(indabom) [mmw@rincewind indabom]$ ./manage.py migrate
System check identified some issues:

WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
	HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode
Operations to perform:
  Apply all migrations: admin, auth, bom, contenttypes, sessions
Running migrations:
  Applying bom.0001_squashed_0018_auto_20170418_0330...Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 109, in __exit__
    self.execute(sql)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 136, in execute
    cursor.execute(sql, params)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/home/mmw/.virtualenvs/indabom/lib/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
django.db.utils.ProgrammingError: (1146, "Table 'indabom.bom_distributorpart' doesn't exist")

It's been a while since I last touched Django (I tend to use flask these days), but it looks to me as if there's a migration missing that creates that table?

This is from the latest version available in pip:

Django==1.11.14
django-bom==0.67
mysqlclient==1.3.13
pytz==2018.5

Failing initial Migrations

Applying bom.0001_squashed_0018_auto_20170418_0330...Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
fake_initial=fake_initial,
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 93, in exit
self.execute(sql)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 120, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "bom_distributorpart" does not exist

OperationalError when creating an Organization

Is this a known error? Or a mistake in the name auth_user__old maybe?

OperationalError at /admin/bom/organization/add/
no such table: main.auth_user__old
Request Method:	POST
Request URL:	http://127.0.0.1:8000/admin/bom/organization/add/?_to_field=id&_popup=1
Django Version:	2.1.3
Exception Type:	OperationalError
Exception Value:	
no such table: main.auth_user__old
Exception Location:	/tmp/mysite/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 296
Python Executable:	/tmp/mysite/bin/python
Python Version:	3.7.1
Python Path:	
['/tmp/mysite/mysite',
 '/tmp/mysite/lib/python37.zip',
 '/tmp/mysite/lib/python3.7',
 '/tmp/mysite/lib/python3.7/lib-dynload',
 '/usr/lib64/python3.7',
 '/usr/lib/python3.7',
 '/tmp/mysite/lib/python3.7/site-packages']
Server time:	Thu, 3 Jan 2019 16:46:25 +0000

Upload / Import a full BOM

I do wish there was a way to upload BOMs rather than just lists of parts. I still have to build out the individual sub-assemblies and all of that. I haven't found a way to upload that manually. I tried downloading the indented BOM of a test assembly, modifying, and uploading: alas, no dice. Is there a way to do that? Is that a feature that can be added?

Duplicate parts can get created when uploading

Upload parts that already exist, then try to add those parts to a BOM

  1. create a user in an organization using intelligent part numbering
  2. upload parts: test_new_parts_5_intelligent.csv
  3. upload parts: test_new_parts_5_intelligent.csv again
  4. go to a bom, and upload bom: test_bom_5_intelligent.csv

Will get error: Found 2 entries for part 2 for subpart on row C0402X5R10V001. This should not happen. Please let [email protected] know. Uploading of this subpart skipped.

Variants

Would it be possible to create variants of items? I can create a new revision of a part, but I have designs that have different parts and different grades of part based on requirements.

Part Entry Form Variation field Input Limited

If the variation length of a part is changed to greater than 2, then the part entry form won't allow more than two characters to be entered, but declares that the part variation should have the new value.

To reproduce:

  1. Increase the part variation field to 3
  2. Attempt part entry -- only allows for 2 characters, but also fails due claiming it should now be three characters.
  3. Attempts to set part variation field to 2 is also rejected as 3 is now the minimum value.

Add supplier parts view

A view that goes through all suppliers and identifies what they made for an organization.

Notes about running from git with mysql

The pipenv install phase requires compiling mysql python integration from source. There should be a note around installing libmysqlclient-dev or similar from the OS. Produced this error on WSL.

[pipenv.exceptions.InstallError]: error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   × Getting requirements to build wheel did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [27 lines of output]
[pipenv.exceptions.InstallError]:       /bin/sh: 1: mysql_config: not found
[pipenv.exceptions.InstallError]:       /bin/sh: 1: mariadb_config: not found
[pipenv.exceptions.InstallError]:       /bin/sh: 1: mysql_config: not found
[pipenv.exceptions.InstallError]:       mysql_config --version
[pipenv.exceptions.InstallError]:       mariadb_config --version
[pipenv.exceptions.InstallError]:       mysql_config --libs

Installation guide

Hi, I'm just trying to install.

I think the starting from scratch install guide should mention that dependencies from requirements.txt should be installed with pip install -r requirements.txt. Instead of just pip install django

Possible to create invalid part number classes

Using the part class edit page (/bom/settings/user/#indabom), it's possible to create a part class that is 2 digits long:

image

It's possible to use the "add part" interface to create a part in this class:

image

But if you try and add that part to another part's BOM, it doesn't work, and the UI spits out a confusing error:

image

I think:

  • It should be clarified if part classes must be three digits
  • If they must be three digits, the part class page should enforce that

Duplicate part

it would be nice to copy an item (like an assembly) to keep the BOM intact but make a new parent part number and then edit the parent to create a variant.

Have a way to bulk edit properties

This is especially useful when editing Qty for multiple parts.

it would be great to bulk edit fields, like qty or MFG'er without having to click on each item

Screen Shot 2020-10-25 at 10 41 01 PM

Add picture to component in detail view

Allowing the user to upload a picture when the component is being created/edited would allow for easier identification of the component. This is useful when components have very similar descriptions but different uses (think "M2.5x6 spacer" vs "M2.5x6 screw").

This picture could be referenced from Google Drive.

See example picture for example:
ScreenShot2020-10-28at10 12 03AM-1-1000x351

Inventory management

Each part revision to have inventory tracking including quantity and location (thanks @lcesero) of that quantity.
May be interesting to add seller inventory, similarly have a single field that can be updated

Let's discuss further before starting on this feature.

Auto-complete during 'Edit BOM'

To help with usability, an auto search or auto complete for adding new items to a BOM would make it much faster and easier to create BOM structures. Without this, one needs to already know all of their part numbers beforehand which means they basically already need a bom in front of them

Create a manufacturing order

Via @hecko here
Is there a way to create a "manufacturing order" - that is - lets say we have this product which contains 300+ electronic parts including plastic parts and sub assemblies etc - is there a way to klick "Im now making 100 units of this product" and Idabom will check which parts are in stock, which need to be bought or 3d printed / manufactured ...

requirements.txt fails at mysqlclient -1.3.13

Following the Start from Scratch: Use as a standalone Django Project. I've tried on both Ubuntu 18.04 and 20.04

Collecting mysqlclient==1.3.13 Downloading mysqlclient-1.3.13.tar.gz (90 kB) |████████████████████████████████| 90 kB 5.3 MB/s ERROR: Command errored out with exit status 1: command: /home/patrick/.virtualenvs/django-bom01/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wjlk8b4m/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wjlk8b4m/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-wjlk8b4m/mysqlclient/pip-egg-info cwd: /tmp/pip-install-wjlk8b4m/mysqlclient/ Complete output (10 lines): /bin/sh: 1: mysql_config: not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-wjlk8b4m/mysqlclient/setup.py", line 18, in <module> metadata, options = get_config() File "/tmp/pip-install-wjlk8b4m/mysqlclient/setup_posix.py", line 53, in get_config libs = mysql_config("libs_r") File "/tmp/pip-install-wjlk8b4m/mysqlclient/setup_posix.py", line 28, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Update reference to User model in Organization and UserMeta models to `settings.AUTH_USER_MODEL`

In django 3.2, Referencing the User Model:

If you reference [User](https://docs.djangoproject.com/en/3.2/ref/contrib/auth/#django.contrib.auth.models.User) 
directly (for example, by referring to it in a foreign key), your code will not work in projects where the
[AUTH_USER_MODEL](https://docs.djangoproject.com/en/3.2/ref/settings/#std-setting-AUTH_USER_MODEL) 
setting has been changed to a different user model.

This includes the owner field in Organization model and user field in UserMeta model.

RecursionError: maximum recursion depth exceeded while calling a Python object on Python 3.8

RecursionError: maximum recursion depth exceeded while calling a Python object on Python 3.8

  File "/Users/azat/.pyenv/versions/Web/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/Users/azat/.pyenv/versions/Web/lib/python3.8/site-packages/django/urls/resolvers.py", line 410, in check
    messages.extend(self._check_custom_error_handlers())
  File "/Users/azat/.pyenv/versions/Web/lib/python3.8/site-packages/django/urls/resolvers.py", line 427, in _check_custom_error_handlers
    signature = inspect.signature(handler)
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/inspect.py", line 3093, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/inspect.py", line 2842, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/inspect.py", line 2292, in _signature_from_callable
    return _signature_from_function(sigcls, obj,
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/inspect.py", line 2156, in _signature_from_function
    parameters.append(Parameter(name, annotation=annotation,
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/inspect.py", line 2479, in __init__
    self._kind = _ParameterKind(kind)
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/enum.py", line 309, in __call__
    return cls.__new__(cls, value)
  File "/Users/azat/.pyenv/versions/3.8.5/lib/python3.8/enum.py", line 566, in __new__
    if type(value) is cls:
RecursionError: maximum recursion depth exceeded while calling a Python object

This is a fresh django installation and nothing except the django-bom

Adding a part with a manufacturer causes error

Entering a value in the "Manufacturer part number" and "Create a New Manufacturer" fields on the "Create a Part" page (/bom/create-part/) causes an error that results in a 500 being returned.

Reproduce steps:

  1. Attempt to create a part with the following properties:
  • P/N class: 101 (the first in my list)
  • Description: example part
  • Manufacturer part number: 123
  • Manufacturer: (leave field at default --------- value)
  • OR Create A New Manufacturer: abc

Expected result: part gets created
Actual result: 500

I don't have an installation of IndaBOM locally yet so I don't have any way to get more debug information right now 😬

Part class is being ignored in search settings

On the dashboard, when searching with part_class, and then going to another page of the search results, the search results reset, removing the filters with part_class.

Steps to replicate:

  1. go to bom dashboard
  2. search for a Part Class
  3. go to another page of the results, by clicking the pagination on the bottom. e.g. 3
  4. The search results reset. removing the search filters input in (2)

API

Create an API to integrate with other apps.

Is there a way to define a seller (supplier) part number ?

For a part, I can define a manufacturer and a manufacturer part number.
I can also define a seller.
Would be great to associate to the seller the seller part, which is the reference used by the seller to identify the component.
Is there a way to do it ?
For example:

Name. Designator Manufacturer Part Manufacturer Supplier Supplier Part
"1uF. C9" "CL21B105KOFNNNE" "SAMSUNG" "LCSC" "C24123"

Thanks
Capture d’écran 2023-01-03 à 16 42 36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.