diff --git a/.eslintrc.yml b/.eslintrc.yml
index 17b64fe..845202d 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,188 +1,188 @@
env:
- browser: true
- es6: true
+ browser: true
+ es6: true
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
- ecmaVersion: 2019
+ ecmaVersion: 2019
overrides:
- - files:
- - "**/*.esm.js"
- parserOptions:
- sourceType: module
+ - files:
+ - "**/*.esm.js"
+ parserOptions:
+ sourceType: module
# Globals available in Odoo that shouldn't produce errorings
globals:
- _: readonly
- $: readonly
- fuzzy: readonly
- jQuery: readonly
- moment: readonly
- odoo: readonly
- openerp: readonly
- owl: readonly
- luxon: readonly
+ _: readonly
+ $: readonly
+ fuzzy: readonly
+ jQuery: readonly
+ moment: readonly
+ odoo: readonly
+ openerp: readonly
+ owl: readonly
+ luxon: readonly
# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
rules:
- accessor-pairs: warn
- array-callback-return: warn
- callback-return: warn
- capitalized-comments:
- - warn
- - always
- - ignoreConsecutiveComments: true
- ignoreInlineComments: true
- complexity:
- - warn
- - 15
- constructor-super: warn
- dot-notation: warn
- eqeqeq: warn
- global-require: warn
- handle-callback-err: warn
- id-blacklist: warn
- id-match: warn
- init-declarations: error
- max-depth: warn
- max-nested-callbacks: warn
- max-statements-per-line: warn
- no-alert: warn
- no-array-constructor: warn
- no-caller: warn
- no-case-declarations: warn
- no-class-assign: warn
- no-cond-assign: error
- no-const-assign: error
- no-constant-condition: warn
- no-control-regex: warn
- no-debugger: error
- no-delete-var: warn
- no-div-regex: warn
- no-dupe-args: error
- no-dupe-class-members: error
- no-dupe-keys: error
- no-duplicate-case: error
- no-duplicate-imports: error
- no-else-return: warn
- no-empty-character-class: warn
- no-empty-function: error
- no-empty-pattern: error
- no-empty: warn
- no-eq-null: error
- no-eval: error
- no-ex-assign: error
- no-extend-native: warn
- no-extra-bind: warn
- no-extra-boolean-cast: warn
- no-extra-label: warn
- no-fallthrough: warn
- no-func-assign: error
- no-global-assign: error
- no-implicit-coercion:
- - warn
- - allow: ["~"]
- no-implicit-globals: warn
- no-implied-eval: warn
- no-inline-comments: warn
- no-inner-declarations: warn
- no-invalid-regexp: warn
- no-irregular-whitespace: warn
- no-iterator: warn
- no-label-var: warn
- no-labels: warn
- no-lone-blocks: warn
- no-lonely-if: error
- no-mixed-requires: error
- no-multi-str: warn
- no-native-reassign: error
- no-negated-condition: warn
- no-negated-in-lhs: error
- no-new-func: warn
- no-new-object: warn
- no-new-require: warn
- no-new-symbol: warn
- no-new-wrappers: warn
- no-new: warn
- no-obj-calls: warn
- no-octal-escape: warn
- no-octal: warn
- no-param-reassign: warn
- no-path-concat: warn
- no-process-env: warn
- no-process-exit: warn
- no-proto: warn
- no-prototype-builtins: warn
- no-redeclare: warn
- no-regex-spaces: warn
- no-restricted-globals: warn
- no-restricted-imports: warn
- no-restricted-modules: warn
- no-restricted-syntax: warn
- no-return-assign: error
- no-script-url: warn
- no-self-assign: warn
- no-self-compare: warn
- no-sequences: warn
- no-shadow-restricted-names: warn
- # no-shadow: warn
- no-sparse-arrays: warn
- no-sync: warn
- no-this-before-super: warn
- no-throw-literal: warn
- no-undef-init: warn
- no-undef: error
- no-unmodified-loop-condition: warn
- no-unneeded-ternary: error
- no-unreachable: error
- no-unsafe-finally: error
- no-unused-expressions: error
- no-unused-labels: error
- no-unused-vars: error
- no-use-before-define: error
- no-useless-call: warn
- no-useless-computed-key: warn
- no-useless-concat: warn
- no-useless-constructor: warn
- no-useless-escape: warn
- no-useless-rename: warn
- no-void: warn
- no-with: warn
- operator-assignment: [error, always]
- prefer-const: warn
- radix: warn
- require-yield: warn
- sort-imports: warn
- spaced-comment: [error, always]
- strict: [error, function]
- use-isnan: error
- valid-jsdoc:
- - warn
- - prefer:
- arg: param
- argument: param
- augments: extends
- constructor: class
- exception: throws
- func: function
- method: function
- prop: property
- return: returns
- virtual: abstract
- yield: yields
- preferType:
- array: Array
- bool: Boolean
- boolean: Boolean
- number: Number
- object: Object
- str: String
- string: String
- requireParamDescription: false
- requireReturn: false
- requireReturnDescription: false
- requireReturnType: false
- valid-typeof: warn
- yoda: warn
\ No newline at end of file
+ accessor-pairs: warn
+ array-callback-return: warn
+ callback-return: warn
+ capitalized-comments:
+ - warn
+ - always
+ - ignoreConsecutiveComments: true
+ ignoreInlineComments: true
+ complexity:
+ - warn
+ - 15
+ constructor-super: warn
+ dot-notation: warn
+ eqeqeq: warn
+ global-require: warn
+ handle-callback-err: warn
+ id-blacklist: warn
+ id-match: warn
+ init-declarations: error
+ max-depth: warn
+ max-nested-callbacks: warn
+ max-statements-per-line: warn
+ no-alert: warn
+ no-array-constructor: warn
+ no-caller: warn
+ no-case-declarations: warn
+ no-class-assign: warn
+ no-cond-assign: error
+ no-const-assign: error
+ no-constant-condition: warn
+ no-control-regex: warn
+ no-debugger: error
+ no-delete-var: warn
+ no-div-regex: warn
+ no-dupe-args: error
+ no-dupe-class-members: error
+ no-dupe-keys: error
+ no-duplicate-case: error
+ no-duplicate-imports: error
+ no-else-return: warn
+ no-empty-character-class: warn
+ no-empty-function: error
+ no-empty-pattern: error
+ no-empty: warn
+ no-eq-null: error
+ no-eval: error
+ no-ex-assign: error
+ no-extend-native: warn
+ no-extra-bind: warn
+ no-extra-boolean-cast: warn
+ no-extra-label: warn
+ no-fallthrough: warn
+ no-func-assign: error
+ no-global-assign: error
+ no-implicit-coercion:
+ - warn
+ - allow: ["~"]
+ no-implicit-globals: warn
+ no-implied-eval: warn
+ no-inline-comments: warn
+ no-inner-declarations: warn
+ no-invalid-regexp: warn
+ no-irregular-whitespace: warn
+ no-iterator: warn
+ no-label-var: warn
+ no-labels: warn
+ no-lone-blocks: warn
+ no-lonely-if: error
+ no-mixed-requires: error
+ no-multi-str: warn
+ no-native-reassign: error
+ no-negated-condition: warn
+ no-negated-in-lhs: error
+ no-new-func: warn
+ no-new-object: warn
+ no-new-require: warn
+ no-new-symbol: warn
+ no-new-wrappers: warn
+ no-new: warn
+ no-obj-calls: warn
+ no-octal-escape: warn
+ no-octal: warn
+ no-param-reassign: warn
+ no-path-concat: warn
+ no-process-env: warn
+ no-process-exit: warn
+ no-proto: warn
+ no-prototype-builtins: warn
+ no-redeclare: warn
+ no-regex-spaces: warn
+ no-restricted-globals: warn
+ no-restricted-imports: warn
+ no-restricted-modules: warn
+ no-restricted-syntax: warn
+ no-return-assign: error
+ no-script-url: warn
+ no-self-assign: warn
+ no-self-compare: warn
+ no-sequences: warn
+ no-shadow-restricted-names: warn
+ # no-shadow: warn
+ no-sparse-arrays: warn
+ no-sync: warn
+ no-this-before-super: warn
+ no-throw-literal: warn
+ no-undef-init: warn
+ no-undef: error
+ no-unmodified-loop-condition: warn
+ no-unneeded-ternary: error
+ no-unreachable: error
+ no-unsafe-finally: error
+ no-unused-expressions: error
+ no-unused-labels: error
+ no-unused-vars: error
+ no-use-before-define: error
+ no-useless-call: warn
+ no-useless-computed-key: warn
+ no-useless-concat: warn
+ no-useless-constructor: warn
+ no-useless-escape: warn
+ no-useless-rename: warn
+ no-void: warn
+ no-with: warn
+ operator-assignment: [error, always]
+ prefer-const: warn
+ radix: warn
+ require-yield: warn
+ sort-imports: warn
+ spaced-comment: [error, always]
+ strict: [error, function]
+ use-isnan: error
+ valid-jsdoc:
+ - warn
+ - prefer:
+ arg: param
+ argument: param
+ augments: extends
+ constructor: class
+ exception: throws
+ func: function
+ method: function
+ prop: property
+ return: returns
+ virtual: abstract
+ yield: yields
+ preferType:
+ array: Array
+ bool: Boolean
+ boolean: Boolean
+ number: Number
+ object: Object
+ str: String
+ string: String
+ requireParamDescription: false
+ requireReturn: false
+ requireReturnDescription: false
+ requireReturnType: false
+ valid-typeof: warn
+ yoda: warn
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b710537..1456874 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,7 +6,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
- .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
+ .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^.pre-commit-config.yaml$|^eslint.config.cjs|^prettier.config.cjs|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
@@ -17,13 +17,10 @@ exclude: |
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
+ # Ignore test files in addons
+ /tests/samples/.*|
# You don't usually want a bot to modify your legal texts
- (LICENSE.*|COPYING.*)|
- # exclude configs itself
- ^\.eslintrc\.yml$|
- ^\.pre-commit-config\.yaml$|
- # Exclude util.py
- /migrations/util.py$
+ (LICENSE.*|COPYING.*)
default_language_version:
python: python3
node: "16.17.0"
@@ -43,18 +40,19 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
- rev: 9a170331575a265c092ee6b24b845ec508e8ef75
+ rev: d5fab7ee87fceee858a3d01048c78a548974d935
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
- args: ["https://www.bakeup.org"]
+ args:
+ - https://www.bakeup.org
- id: oca-gen-addon-readme
args:
- --addons-dir=.
- --branch=16.0
- --org-name=bruecksen
- - --repo-name=ife_nfu
+ - --repo-name=nfu
- --if-source-changed
- --keep-source-digest
- repo: https://github.com/OCA/odoo-pre-commit-hooks
@@ -62,6 +60,8 @@ repos:
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
+ args:
+ - --disable=po-pretty-format
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
@@ -77,30 +77,37 @@ repos:
rev: 22.8.0
hooks:
- id: black
- args:
- - --line-length=120
- - --skip-magic-trailing-comma
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: v2.7.1
+ - repo: local
hooks:
- id: prettier
name: prettier (with plugin-xml)
+ entry: prettier
+ args:
+ - --write
+ - --list-different
+ - --ignore-unknown
+ types: [text]
+ files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
+ language: node
additional_dependencies:
- "prettier@2.7.1"
- "@prettier/plugin-xml@2.2.0"
- args:
- - --plugin=@prettier/plugin-xml
- files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- - repo: https://github.com/pre-commit/mirrors-eslint
- rev: v8.31.0
+ - repo: local
hooks:
- id: eslint
- verbose: true
+ name: eslint
+ entry: eslint
args:
- --color
- --fix
+ verbose: true
+ types: [javascript]
+ language: node
+ additional_dependencies:
+ - "eslint@8.24.0"
+ - "eslint-plugin-jsdoc@"
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.3.0
+ rev: v5.0.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
@@ -134,8 +141,18 @@ repos:
args:
- --settings=.
exclude: /__init__\.py$
+ - repo: https://github.com/acsone/setuptools-odoo
+ rev: 3.1.8
+ hooks:
+ - id: setuptools-odoo-make-default
+ - id: setuptools-odoo-get-requirements
+ args:
+ - --output
+ - requirements.txt
+ - --header
+ - "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
- rev: 3.9.2
+ rev: 5.0.0
hooks:
- id: flake8
name: flake8
diff --git a/nfu_ecommerce/README.rst b/nfu_ecommerce/README.rst
index 3013392..e4754b0 100644
--- a/nfu_ecommerce/README.rst
+++ b/nfu_ecommerce/README.rst
@@ -16,9 +16,9 @@ NFU eCommerce
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_ecommerce
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_ecommerce
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -48,10 +48,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -72,6 +72,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_ecommerce/controllers/main.py b/nfu_ecommerce/controllers/main.py
index 925a21e..a2818c4 100644
--- a/nfu_ecommerce/controllers/main.py
+++ b/nfu_ecommerce/controllers/main.py
@@ -11,19 +11,30 @@ class WebsiteSaleMinMax(WebsiteSale):
"""Override to get ordered_qty and max_qty from the product."""
product_uom_ordered_qty = fields.Float(ordered_qty)
product_uom_max_qty = fields.Float(max_qty)
- return super().cart_update(*args, ordered_qty=product_uom_ordered_qty, max_qty=product_uom_max_qty, **kw)
+ return super().cart_update(
+ *args,
+ ordered_qty=product_uom_ordered_qty,
+ max_qty=product_uom_max_qty,
+ **kw
+ )
class WebsiteSale(WebsiteSale):
def _get_additional_shop_values(self, values):
new_values = super()._get_additional_shop_values(values)
- new_values["open_packagings"] = True if request.httprequest.args.get("open_packagings") else False
+ new_values["open_packagings"] = (
+ True if request.httprequest.args.get("open_packagings") else False
+ )
# ToDo: Add batch qtys if open batch
batch = request.website.sale_get_order(force_create=True).batch_id
batch_products = batch.product_ids.filtered(lambda p: p.product_packaging_id)
packaging_info = {}
- for product in values.get("products").sudo().filtered(lambda p: p.packaging_ids):
- batch_product = batch_products.filtered(lambda p: p.product_template_id == product)
+ for product in (
+ values.get("products").sudo().filtered(lambda p: p.packaging_ids)
+ ):
+ batch_product = batch_products.filtered(
+ lambda p: p.product_template_id == product
+ )
if batch_product:
batch_product = batch_product[0]
state_color = batch_product.get_state_color()
@@ -36,11 +47,15 @@ class WebsiteSale(WebsiteSale):
"package_qty": batch_product.product_packaging_qty,
}
new_values["packaging_info"] = packaging_info
- new_values["get_product_packagings"] = lambda product: lazy(lambda: packaging_info.get(product.id, False))
+ new_values["get_product_packagings"] = lambda product: lazy(
+ lambda: packaging_info.get(product.id, False)
+ )
return new_values
def _prepare_product_values(self, product, category, search, **kwargs):
- new_values = super()._prepare_product_values(product, category, search, **kwargs)
+ new_values = super()._prepare_product_values(
+ product, category, search, **kwargs
+ )
batch = request.website.sale_get_order(force_create=True).batch_id
batch_product = batch.product_ids.filtered(
lambda p: p.product_template_id == product and p.product_packaging_id
@@ -59,7 +74,14 @@ class WebsiteSale(WebsiteSale):
return new_values
def _get_search_options(
- self, category=None, attrib_values=None, pricelist=None, min_price=0.0, max_price=0.0, conversion_rate=1, **post
+ self,
+ category=None,
+ attrib_values=None,
+ pricelist=None,
+ min_price=0.0,
+ max_price=0.0,
+ conversion_rate=1,
+ **post
):
res = super()._get_search_options(
category=category,
@@ -84,18 +106,35 @@ class WebsiteSale(WebsiteSale):
auth="public",
website=True,
)
- def shop(self, page=0, category=None, search="", min_price=0.0, max_price=0.0, ppg=False, **post):
+ def shop(
+ self,
+ page=0,
+ category=None,
+ search="",
+ min_price=0.0,
+ max_price=0.0,
+ ppg=False,
+ **post
+ ):
open_packages = bool(post.get("open_packagings"))
if open_packages:
batch = request.website.sale_get_order(force_create=True).batch_id
open_product_ids = (
- batch.product_ids.filtered(lambda p: p.open_packaging_qty > 0).mapped("product_template_id").ids
+ batch.product_ids.filtered(lambda p: p.open_packaging_qty > 0)
+ .mapped("product_template_id")
+ .ids
)
post["open_product_ids"] = open_product_ids
else:
post["open_product_ids"] = None
res = super().shop(
- page=page, category=category, search=search, min_price=min_price, max_price=max_price, ppg=ppg, **post
+ page=page,
+ category=category,
+ search=search,
+ min_price=min_price,
+ max_price=max_price,
+ ppg=ppg,
+ **post
)
return res
diff --git a/nfu_ecommerce/models/product_template.py b/nfu_ecommerce/models/product_template.py
index f6fe7fd..239d45c 100644
--- a/nfu_ecommerce/models/product_template.py
+++ b/nfu_ecommerce/models/product_template.py
@@ -5,7 +5,10 @@ class ProductTemplate(models.Model):
_inherit = "product.template"
is_published = fields.Boolean(
- copy=False, default=lambda self: self._default_is_published(), index=True, company_dependent=True
+ copy=False,
+ default=lambda self: self._default_is_published(),
+ index=True,
+ company_dependent=True,
)
def action_publish_on_website(self):
diff --git a/nfu_ecommerce/models/sale_order.py b/nfu_ecommerce/models/sale_order.py
index c1b3b1c..668a344 100644
--- a/nfu_ecommerce/models/sale_order.py
+++ b/nfu_ecommerce/models/sale_order.py
@@ -14,7 +14,9 @@ class SaleOrder(models.Model):
@api.depends("amount_total")
def _compute_updated_balance(self):
for order in self:
- order.updated_balance = order.balance - (order.amount_total / order.currency_rate)
+ order.updated_balance = order.balance - (
+ order.amount_total / order.currency_rate
+ )
def _prepare_order_line_values(
self,
@@ -33,10 +35,17 @@ class SaleOrder(models.Model):
product_custom_attribute_values=product_custom_attribute_values,
**kwargs
)
- values.update({"product_uom_ordered_qty": quantity, "product_uom_max_qty": kwargs.get("max_qty", quantity)})
+ values.update(
+ {
+ "product_uom_ordered_qty": quantity,
+ "product_uom_max_qty": kwargs.get("max_qty", quantity),
+ }
+ )
return values
- def _prepare_order_line_update_values(self, order_line, quantity, linked_line_id=False, **kwargs):
+ def _prepare_order_line_update_values(
+ self, order_line, quantity, linked_line_id=False, **kwargs
+ ):
values = super()._prepare_order_line_update_values(
order_line, quantity, linked_line_id=linked_line_id, **kwargs
)
diff --git a/nfu_ecommerce/static/description/index.html b/nfu_ecommerce/static/description/index.html
index e659d9c..3378c3d 100644
--- a/nfu_ecommerce/static/description/index.html
+++ b/nfu_ecommerce/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4dfaea54e4d01502b433eb5c0dcca409a5fbe2c3f175e29382a19230343183c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds a maximum order quantity field to Website Sale Orders. It also adds
an ordered qantitiy field to store the original ordered quantity in case a manager
adjustes the uom quantitiy. In webshop checkout it adds the customer balance to before
@@ -416,10 +416,10 @@ and after the current order.
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -439,7 +439,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/nfu_ekg_stock/README.rst b/nfu_ekg_stock/README.rst
index 0340d2b..380020a 100644
--- a/nfu_ekg_stock/README.rst
+++ b/nfu_ekg_stock/README.rst
@@ -16,9 +16,9 @@ NFU EKG Stock
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_ekg_stock
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_ekg_stock
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -41,10 +41,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -59,6 +59,6 @@ Authors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_ekg_stock/__manifest__.py b/nfu_ekg_stock/__manifest__.py
index 6423ef2..19aa586 100644
--- a/nfu_ekg_stock/__manifest__.py
+++ b/nfu_ekg_stock/__manifest__.py
@@ -12,7 +12,11 @@
"views/report_packing_list.xml",
"report/stock_report_views.xml",
],
- "assets": {"web.report_assets_common": ["nfu_ekg_stock/static/src/scss/report_stock_rule.scss"]},
+ "assets": {
+ "web.report_assets_common": [
+ "nfu_ekg_stock/static/src/scss/report_stock_rule.scss"
+ ]
+ },
"license": "LGPL-3",
"application": True,
}
diff --git a/nfu_ekg_stock/static/description/index.html b/nfu_ekg_stock/static/description/index.html
index 197c8a8..11970c8 100644
--- a/nfu_ekg_stock/static/description/index.html
+++ b/nfu_ekg_stock/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4dfaea54e4d01502b433eb5c0dcca409a5fbe2c3f175e29382a19230343183c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds EKG-specific stock c functionalities for the “Nachschub für uns”-Project
- small delivery slips
Table of contents
@@ -392,10 +392,10 @@ ul.auto-toc {
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -408,7 +408,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/nfu_product/README.rst b/nfu_product/README.rst
index 96aa564..c49a93c 100644
--- a/nfu_product/README.rst
+++ b/nfu_product/README.rst
@@ -16,9 +16,9 @@ NFU Product
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_product
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_product
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -40,10 +40,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -63,6 +63,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_product/models/product_product.py b/nfu_product/models/product_product.py
index 5c23618..e78139a 100644
--- a/nfu_product/models/product_product.py
+++ b/nfu_product/models/product_product.py
@@ -9,14 +9,18 @@ class ProductProduct(models.Model):
for product in self:
company_ids = vals.get("company_ids", [])[0][2]
if company_ids:
- related_packages = self.env["product.packaging"].search([("product_id", "=", product.id)])
+ related_packages = self.env["product.packaging"].search(
+ [("product_id", "=", product.id)]
+ )
# First, set the company_ids on packages if not set
for package in related_packages:
if not package.company_ids:
package.company_ids = product.company_ids
else:
- allowed_company_ids = list(set(package.company_ids.ids) & set(company_ids))
+ allowed_company_ids = list(
+ set(package.company_ids.ids) & set(company_ids)
+ )
if not allowed_company_ids:
package.company_ids = [(6, 0, company_ids)]
else:
diff --git a/nfu_product/static/description/index.html b/nfu_product/static/description/index.html
index 777c34e..7ca2cf7 100644
--- a/nfu_product/static/description/index.html
+++ b/nfu_product/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1b38428d6cd06a0605518e76e4c89cb55b01114d59a8a1ef38ebcc5129c57305
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

- Remove company_id and add company_ids to views
@@ -396,10 +396,10 @@ ul.auto-toc {
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -418,7 +418,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/nfu_product_bnn_attributes/README.rst b/nfu_product_bnn_attributes/README.rst
index 9ff0080..7b95336 100644
--- a/nfu_product_bnn_attributes/README.rst
+++ b/nfu_product_bnn_attributes/README.rst
@@ -16,9 +16,9 @@ NFU BNN Attributes
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_product_bnn_attributes
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_product_bnn_attributes
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -43,10 +43,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -66,6 +66,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_product_bnn_attributes/models/product_template.py b/nfu_product_bnn_attributes/models/product_template.py
index 4a22a8b..b5e15c3 100644
--- a/nfu_product_bnn_attributes/models/product_template.py
+++ b/nfu_product_bnn_attributes/models/product_template.py
@@ -18,7 +18,9 @@ class ProductTemplate(models.Model):
for product in self:
qty = vals.get("packaging_qty") or product.packaging_qty
name = vals.get("packaging_name") or product.packaging_name
- product_products = self.env["product.product"].search([("product_tmpl_id", "=", product.id)])
+ product_products = self.env["product.product"].search(
+ [("product_tmpl_id", "=", product.id)]
+ )
if qty and name:
for product_product in product_products:
packagings = self.env["product.packaging"].search(
diff --git a/nfu_product_bnn_attributes/static/description/index.html b/nfu_product_bnn_attributes/static/description/index.html
index d8aadcc..dbe1853 100644
--- a/nfu_product_bnn_attributes/static/description/index.html
+++ b/nfu_product_bnn_attributes/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:134ea25670afe61406a31cb8ab2661c3b00137b759c76a3241a78d7e56d21ebe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds a page to product form view to store BNN Attributes.
Table of contents
@@ -397,10 +397,10 @@ ul.auto-toc {
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -419,7 +419,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/nfu_sale_order_batch_packaging/README.rst b/nfu_sale_order_batch_packaging/README.rst
index 9698cf1..2cd979c 100644
--- a/nfu_sale_order_batch_packaging/README.rst
+++ b/nfu_sale_order_batch_packaging/README.rst
@@ -16,9 +16,9 @@ NFU Sale Order Batch Packaging
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_sale_order_batch_packaging
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_sale_order_batch_packaging
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -52,10 +52,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -76,6 +76,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_sale_order_batch_packaging/models/sale_order_batch_product.py b/nfu_sale_order_batch_packaging/models/sale_order_batch_product.py
index fbd2660..343c46e 100644
--- a/nfu_sale_order_batch_packaging/models/sale_order_batch_product.py
+++ b/nfu_sale_order_batch_packaging/models/sale_order_batch_product.py
@@ -1,23 +1,39 @@
from odoo import api, fields, models
-PACKAGING_STATES = [("open", "Open"), ("full", "Full"), ("last_open", "Last package open")]
+PACKAGING_STATES = [
+ ("open", "Open"),
+ ("full", "Full"),
+ ("last_open", "Last package open"),
+]
class SaleOrderBatchProduct(models.Model):
_inherit = "sale.order.batch.product"
product_uom_max_qty = fields.Float(
- "Max Qty", compute="_compute_product_uom_max_qty", precompute=True, store=True, digits=[12, 3]
+ "Max Qty",
+ compute="_compute_product_uom_max_qty",
+ precompute=True,
+ store=True,
+ digits=[12, 3],
+ )
+ open_packaging_qty = fields.Float(
+ compute="_compute_open_packaging_qty", store=True, digits=[12, 3]
+ )
+ open_packaging_max_qty = fields.Float(
+ compute="_compute_open_packaging_max_qty", store=True, digits=[12, 3]
+ )
+ open_packaging_state = fields.Selection(
+ selection=PACKAGING_STATES, compute="_compute_open_packaging_state"
)
- open_packaging_qty = fields.Float(compute="_compute_open_packaging_qty", store=True, digits=[12, 3])
- open_packaging_max_qty = fields.Float(compute="_compute_open_packaging_max_qty", store=True, digits=[12, 3])
- open_packaging_state = fields.Selection(selection=PACKAGING_STATES, compute="_compute_open_packaging_state")
@api.depends("sale_order_line_ids.product_uom_max_qty")
def _compute_product_uom_max_qty(self):
for product in self:
- product.product_uom_max_qty = sum(product.sale_order_line_ids.mapped("product_uom_max_qty"))
+ product.product_uom_max_qty = sum(
+ product.sale_order_line_ids.mapped("product_uom_max_qty")
+ )
@api.depends("product_uom_qty")
def _compute_open_packaging_qty(self):
@@ -27,7 +43,9 @@ class SaleOrderBatchProduct(models.Model):
product.product_uom_qty % product.product_packaging_qty, 3
)
product.open_packaging_qty = (
- 0.0 if open_packaging_qty == product.product_packaging_qty else open_packaging_qty
+ 0.0
+ if open_packaging_qty == product.product_packaging_qty
+ else open_packaging_qty
)
else:
product.open_packaging_qty = 0.0
@@ -36,9 +54,16 @@ class SaleOrderBatchProduct(models.Model):
def _compute_open_packaging_max_qty(self):
for product in self:
if product.product_packaging_id:
- if product.product_uom_max_qty < product.product_uom_qty + product.open_packaging_qty:
- product.open_packaging_max_qty = product.product_packaging_qty - round(
- product.product_uom_max_qty % product.product_packaging_qty, 3
+ if (
+ product.product_uom_max_qty
+ < product.product_uom_qty + product.open_packaging_qty
+ ):
+ product.open_packaging_max_qty = (
+ product.product_packaging_qty
+ - round(
+ product.product_uom_max_qty % product.product_packaging_qty,
+ 3,
+ )
)
else:
product.open_packaging_max_qty = 0.0
@@ -60,7 +85,9 @@ class SaleOrderBatchProduct(models.Model):
for vals in vals_list:
if vals.get("product_id") and not vals.get("product_packaging_id"):
packaging = (
- self.env["product.product"].search([("id", "=", vals.get("product_id"))])._get_nfu_packaging()
+ self.env["product.product"]
+ .search([("id", "=", vals.get("product_id"))])
+ ._get_nfu_packaging()
)
if packaging:
vals["product_packaging_id"] = packaging.id
diff --git a/nfu_sale_order_batch_packaging/models/sale_order_line.py b/nfu_sale_order_batch_packaging/models/sale_order_line.py
index 2ca3586..6ffa655 100644
--- a/nfu_sale_order_batch_packaging/models/sale_order_line.py
+++ b/nfu_sale_order_batch_packaging/models/sale_order_line.py
@@ -5,10 +5,18 @@ from odoo.exceptions import UserError
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
- product_uom_ordered_qty = fields.Float(string="Ordered Qty", digits="Product Unit of Measure", default=1.0)
- product_uom_max_qty = fields.Float(string="Max Qty", digits="Product Unit of Measure")
- batch_uom_qty = fields.Float(related="batch_product_id.product_uom_qty", string="Batch UOM Qty")
- batch_uom_max_qty = fields.Float(related="batch_product_id.product_uom_max_qty", string="Batch UOM Max Qty")
+ product_uom_ordered_qty = fields.Float(
+ string="Ordered Qty", digits="Product Unit of Measure", default=1.0
+ )
+ product_uom_max_qty = fields.Float(
+ string="Max Qty", digits="Product Unit of Measure"
+ )
+ batch_uom_qty = fields.Float(
+ related="batch_product_id.product_uom_qty", string="Batch UOM Qty"
+ )
+ batch_uom_max_qty = fields.Float(
+ related="batch_product_id.product_uom_max_qty", string="Batch UOM Max Qty"
+ )
@api.constrains("product_uom_qty", "product_uom_max_qty")
def _check_product_uom_qty(self):
@@ -16,7 +24,7 @@ class SaleOrderLine(models.Model):
if order_line.product_uom_qty > order_line.product_uom_max_qty:
raise UserError(
_(
- f"{order_line.order_id.name},{order_line.product_id.name}:"
+ f"{order_line.order_id.name}, {order_line.product_id.name}: "
"The quantity must be less than or equal to the maximum quantity."
)
)
@@ -24,12 +32,17 @@ class SaleOrderLine(models.Model):
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
- if not vals.get("product_uom_max_qty") or vals.get("product_uom_max_qty") == 0:
+ if (
+ not vals.get("product_uom_max_qty")
+ or vals.get("product_uom_max_qty") == 0
+ ):
product_qty = vals.get("product_uom_qty")
vals["product_uom_max_qty"] = product_qty
if vals.get("product_id") and not vals.get("product_packaging_id"):
product_id = vals.get("product_id")
- packaging = self.env["product.packaging"].search([("product_id", "=", product_id)], limit=1)
+ packaging = self.env["product.packaging"].search(
+ [("product_id", "=", product_id)], limit=1
+ )
vals["product_packaging_id"] = packaging.id
return super().create(vals_list)
diff --git a/nfu_sale_order_batch_packaging/static/description/index.html b/nfu_sale_order_batch_packaging/static/description/index.html
index d5627f4..8f0219c 100644
--- a/nfu_sale_order_batch_packaging/static/description/index.html
+++ b/nfu_sale_order_batch_packaging/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cf35c3a80aa0718148099036cd6a3dd60afb61acdb420573b1bd129be3ea2cf1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds a minium and a maximum order quantity field to Sale Orders
and adds a packaging default to sale order batch.
Table of contents
@@ -434,10 +434,10 @@ and adds a packaging default to sale order batch.
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -457,7 +457,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/nfu_wholesaler_exporter/README.rst b/nfu_wholesaler_exporter/README.rst
index 4e40209..3083593 100644
--- a/nfu_wholesaler_exporter/README.rst
+++ b/nfu_wholesaler_exporter/README.rst
@@ -16,9 +16,9 @@ NFU Wholesaler Exporter
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_wholesaler_exporter
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/nfu_wholesaler_exporter
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -51,10 +51,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -74,6 +74,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/nfu_wholesaler_exporter/models/sale_order_batch.py b/nfu_wholesaler_exporter/models/sale_order_batch.py
index 80a30fa..0858297 100644
--- a/nfu_wholesaler_exporter/models/sale_order_batch.py
+++ b/nfu_wholesaler_exporter/models/sale_order_batch.py
@@ -13,12 +13,23 @@ class SaleOrderBatch(models.Model):
# Prepare CSV content
csv_content = "Artnr,Menge\n"
for product in self.product_ids.filtered(lambda p: p.product_id.default_code):
- if not float_is_zero(product.product_uom_qty, precision_rounding=product.product_id.uom_id.rounding):
+ if not float_is_zero(
+ product.product_uom_qty,
+ precision_rounding=product.product_id.uom_id.rounding,
+ ):
# We think 10g variance is okay
- if not float_is_zero(product.open_packaging_qty, precision_rounding=0.01):
- raise UserError(_(f"Packaging is still open for product {product.product_id.name}"))
- wholesaler_qty = int(round(product.product_uom_qty / product.product_packaging_qty))
- csv_content += f"{product.product_id.default_code},{wholesaler_qty}\n"
+ if not float_is_zero(
+ product.open_packaging_qty, precision_rounding=0.01
+ ):
+ raise UserError(
+ _(
+ f"Packaging is still open for product {product.product_id.name}"
+ )
+ )
+ wholesaler_qty = int(
+ round(product.product_uom_qty / product.product_packaging_qty)
+ )
+ csv_content += f"{product.product_id.default_code},{wholesaler_qty}\n" # noqa: E231
# Encode CSV content to base64
csv_base64 = base64.b64encode(csv_content.encode("utf-8"))
@@ -34,4 +45,8 @@ class SaleOrderBatch(models.Model):
}
)
- return {"type": "ir.actions.act_url", "url": f"/web/content/{attachment.id}?download=true", "target": "self"}
+ return {
+ "type": "ir.actions.act_url",
+ "url": f"/web/content/{attachment.id}?download=true",
+ "target": "self",
+ }
diff --git a/nfu_wholesaler_exporter/static/description/index.html b/nfu_wholesaler_exporter/static/description/index.html
index de6bb6e..f2ed5d3 100644
--- a/nfu_wholesaler_exporter/static/description/index.html
+++ b/nfu_wholesaler_exporter/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f5c1fd3329fff4e1de63fae68edca9ba70a1f2444b6674d5fac9ede1a6ff1f94
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds a CSV exporter action to Sale Order Batch module.
It exports the article number (default_code) and the qty of the Sale Order Batch
Product view.
@@ -420,10 +420,10 @@ Das ist aktuell der default_code, falls wir den mal prefixen, muss das hier ange
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -442,7 +442,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/sale_order_batch/README.rst b/sale_order_batch/README.rst
index 618b60d..f52642d 100644
--- a/sale_order_batch/README.rst
+++ b/sale_order_batch/README.rst
@@ -16,9 +16,9 @@ Sale Order Batch
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/sale_order_batch
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/sale_order_batch
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -48,10 +48,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -71,6 +71,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/sale_order_batch/models/sale_order.py b/sale_order_batch/models/sale_order.py
index 46c2f56..5398cc1 100644
--- a/sale_order_batch/models/sale_order.py
+++ b/sale_order_batch/models/sale_order.py
@@ -5,7 +5,12 @@ from odoo.exceptions import UserError
class SaleOrder(models.Model):
_inherit = "sale.order"
- batch_id = fields.Many2one("sale.order.batch", copy=False, check_company=True, domain="[('state','!=','closed')]")
+ batch_id = fields.Many2one(
+ "sale.order.batch",
+ copy=False,
+ check_company=True,
+ domain="[('state','!=','closed')]",
+ )
def _get_current_batch(self):
"""
@@ -47,7 +52,9 @@ class SaleOrder(models.Model):
if order.batch_id:
invalid_orders.append(order.name)
if invalid_orders:
- raise UserError(_(f"Sale Order belongs to a Batch: {', '.join(invalid_orders)}"))
+ raise UserError(
+ _(f"Sale Order belongs to a Batch: {', '.join(invalid_orders)}")
+ )
return super().action_confirm()
def write(self, vals):
diff --git a/sale_order_batch/models/sale_order_batch.py b/sale_order_batch/models/sale_order_batch.py
index c40b53f..eac06e2 100644
--- a/sale_order_batch/models/sale_order_batch.py
+++ b/sale_order_batch/models/sale_order_batch.py
@@ -3,7 +3,12 @@ from odoo import _, api, fields, models
from odoo.addons.sale.models.sale_order import INVOICE_STATUS
-STATES = [("open", "Open"), ("in_progress", "In Progress"), ("closed", "Closed"), ("cancel", "Cancelled")]
+STATES = [
+ ("open", "Open"),
+ ("in_progress", "In Progress"),
+ ("closed", "Closed"),
+ ("cancel", "Cancelled"),
+]
READONLY_FIELD_STATES = {state: [("readonly", True)] for state in {"closed"}}
@@ -25,10 +30,19 @@ class SaleOrderBatch(models.Model):
default=lambda self: _("New"),
)
company_id = fields.Many2one(
- comodel_name="res.company", required=True, index=True, default=lambda self: self.env.company
+ comodel_name="res.company",
+ required=True,
+ index=True,
+ default=lambda self: self.env.company,
)
state = fields.Selection(
- selection=STATES, string="Status", readonly=True, copy=False, index=True, tracking=1, default="open"
+ selection=STATES,
+ string="Status",
+ readonly=True,
+ copy=False,
+ index=True,
+ tracking=1,
+ default="open",
)
date_order = fields.Datetime(
string="Order Date",
@@ -41,10 +55,14 @@ class SaleOrderBatch(models.Model):
)
sale_order_ids = fields.One2many("sale.order", "batch_id")
sale_order_count = fields.Integer(compute="_compute_sale_order_count")
- sale_order_line_ids = fields.One2many("sale.order.line", "batch_id", states=READONLY_FIELD_STATES)
+ sale_order_line_ids = fields.One2many(
+ "sale.order.line", "batch_id", states=READONLY_FIELD_STATES
+ )
invoice_ids = fields.Many2many("account.move", compute="_compute_invoice_ids")
invoice_count = fields.Integer(compute="_compute_invoice_ids")
- invoice_status = fields.Selection(selection=INVOICE_STATUS, compute="_compute_invoice_status", store=True)
+ invoice_status = fields.Selection(
+ selection=INVOICE_STATUS, compute="_compute_invoice_status", store=True
+ )
amount_total = fields.Float(compute="_compute_amount_total", string="Total")
product_ids = fields.One2many("sale.order.batch.product", "batch_id")
product_count = fields.Integer(compute="_compute_product_count")
@@ -66,11 +84,13 @@ class SaleOrderBatch(models.Model):
def _compute_invoice_status(self):
for batch in self:
if batch.sale_order_ids and any(
- invoice_status == "to invoice" for invoice_status in batch.sale_order_ids.mapped("invoice_status")
+ invoice_status == "to invoice"
+ for invoice_status in batch.sale_order_ids.mapped("invoice_status")
):
batch.invoice_status = "to invoice"
elif batch.sale_order_ids and all(
- invoice_status == "invoiced" for invoice_status in batch.sale_order_ids.mapped("invoice_status")
+ invoice_status == "invoiced"
+ for invoice_status in batch.sale_order_ids.mapped("invoice_status")
):
batch.invoice_status = "invoiced"
elif batch.sale_order_ids and all(
@@ -113,11 +133,15 @@ class SaleOrderBatch(models.Model):
def action_view_products(self):
self.ensure_one()
- result = self.env["ir.actions.act_window"]._for_xml_id("product.product_normal_action_sell")
+ result = self.env["ir.actions.act_window"]._for_xml_id(
+ "product.product_normal_action_sell"
+ )
if len(self.product_ids) > 1:
result["domain"] = [("id", "in", self.product_ids.ids)]
elif len(self.product_ids) == 1:
- result["views"] = [(self.env.ref("product.product_product_tree_view", False).id, "form")]
+ result["views"] = [
+ (self.env.ref("product.product_product_tree_view", False).id, "form")
+ ]
result["res_id"] = self.product_ids.id
else:
result = {"type": "ir.actions.act_window_close"}
@@ -125,13 +149,17 @@ class SaleOrderBatch(models.Model):
def action_view_invoice(self):
invoices = self.mapped("invoice_ids")
- action = self.env["ir.actions.actions"]._for_xml_id("account.action_move_out_invoice_type")
+ action = self.env["ir.actions.actions"]._for_xml_id(
+ "account.action_move_out_invoice_type"
+ )
if len(invoices) > 1:
action["domain"] = [("id", "in", invoices.ids)]
elif len(invoices) == 1:
form_view = [(self.env.ref("account.view_move_form").id, "form")]
if "views" in action:
- action["views"] = form_view + [(state, view) for state, view in action["views"] if view != "form"]
+ action["views"] = form_view + [
+ (state, view) for state, view in action["views"] if view != "form"
+ ]
else:
action["views"] = form_view
action["res_id"] = invoices.id
@@ -169,5 +197,7 @@ class SaleOrderBatch(models.Model):
if "company_id" in vals:
self = self.with_company(vals["company_id"])
if vals.get("name", _("New")) == _("New"):
- vals["name"] = self.env["ir.sequence"].next_by_code("sale.order.batch") or _("New")
+ vals["name"] = self.env["ir.sequence"].next_by_code(
+ "sale.order.batch"
+ ) or _("New")
return super().create(vals_list)
diff --git a/sale_order_batch/models/sale_order_batch_product.py b/sale_order_batch/models/sale_order_batch_product.py
index f22c443..5a78e45 100644
--- a/sale_order_batch/models/sale_order_batch_product.py
+++ b/sale_order_batch/models/sale_order_batch_product.py
@@ -19,14 +19,26 @@ class SaleOrderBatchProduct(models.Model):
readonly=True,
)
state = fields.Selection(related="batch_id.state")
- product_id = fields.Many2one(comodel_name="product.product", required=True, readonly=True)
- product_template_id = fields.Many2one(
- "product.template", related="product_id.product_tmpl_id", string="Product Template"
+ product_id = fields.Many2one(
+ comodel_name="product.product", required=True, readonly=True
+ )
+ product_template_id = fields.Many2one(
+ "product.template",
+ related="product_id.product_tmpl_id",
+ string="Product Template",
+ )
+ sale_order_line_ids = fields.One2many(
+ "sale.order.line", "batch_product_id", states=READONLY_FIELD_STATES
+ )
+ product_uom_category_id = fields.Many2one(
+ related="product_id.uom_id.category_id", depends=["product_id"]
)
- sale_order_line_ids = fields.One2many("sale.order.line", "batch_product_id", states=READONLY_FIELD_STATES)
- product_uom_category_id = fields.Many2one(related="product_id.uom_id.category_id", depends=["product_id"])
product_uom_qty = fields.Float(
- string="Quantity", compute="_compute_uom_qty", precompute=True, store=True, digits=[12, 3]
+ string="Quantity",
+ compute="_compute_uom_qty",
+ precompute=True,
+ store=True,
+ digits=[12, 3],
)
product_uom = fields.Many2one(related="product_id.uom_id")
lst_price = fields.Float(
@@ -50,26 +62,42 @@ class SaleOrderBatchProduct(models.Model):
@api.constrains("product_id", "sale_order_line_ids")
def _check_sale_order_line_products(self):
for product in self:
- if any(line.product_id != product.product_id for line in product.sale_order_line_ids):
+ if any(
+ line.product_id != product.product_id
+ for line in product.sale_order_line_ids
+ ):
raise ValueError("Product must be the same for all Sale Order Lines")
@api.depends("sale_order_line_ids.product_uom_qty")
def _compute_uom_qty(self):
for product in self:
- product.product_uom_qty = sum(product.sale_order_line_ids.mapped("product_uom_qty"))
+ product.product_uom_qty = sum(
+ product.sale_order_line_ids.mapped("product_uom_qty")
+ )
@api.depends("product_id", "product_uom_qty", "product_uom")
def _compute_product_packaging_id(self):
for line in self:
# remove packaging if not match the product
- if line.product_packaging_id and line.product_packaging_id.product_id != line.product_id:
+ if (
+ line.product_packaging_id
+ and line.product_packaging_id.product_id != line.product_id
+ ):
line.product_packaging_id = False
# suggest always the first packaging
if line.product_id and line.product_uom_qty and line.product_uom:
- suggested_packaging = line.product_id.packaging_ids[0] if line.product_id.packaging_ids else False
- line.product_packaging_id = suggested_packaging or line.product_packaging_id
+ suggested_packaging = (
+ line.product_id.packaging_ids[0]
+ if line.product_id.packaging_ids
+ else False
+ )
+ line.product_packaging_id = (
+ suggested_packaging or line.product_packaging_id
+ )
@api.depends("product_packaging_id")
def _compute_product_packaging_qty(self):
for product in self:
- product.product_packaging_qty = product.product_packaging_id.qty if product.product_packaging_id else 1
+ product.product_packaging_qty = (
+ product.product_packaging_id.qty if product.product_packaging_id else 1
+ )
diff --git a/sale_order_batch/models/sale_order_line.py b/sale_order_batch/models/sale_order_line.py
index 652fc66..0af31ae 100644
--- a/sale_order_batch/models/sale_order_line.py
+++ b/sale_order_batch/models/sale_order_line.py
@@ -12,7 +12,11 @@ class SaleOrderLine(models.Model):
for line in lines_with_batch:
batch_id = line.batch_id
batch_product = self.env["sale.order.batch.product"].search(
- [("product_id", "=", line.product_id.id), ("batch_id", "=", batch_id.id)], limit=1
+ [
+ ("product_id", "=", line.product_id.id),
+ ("batch_id", "=", batch_id.id),
+ ],
+ limit=1,
)
if not batch_product:
batch_product = self.env["sale.order.batch.product"].create(
@@ -30,7 +34,8 @@ class SaleOrderLine(models.Model):
lines_with_batch = self.filtered(lambda l: l.batch_id)
lines_without_batch = self - lines_with_batch
lines_with_batch.filtered(
- lambda l: l.batch_product_id and l.batch_product_id.product_id != l.product_id
+ lambda l: l.batch_product_id
+ and l.batch_product_id.product_id != l.product_id
)._unlink_batch_product()
lines_with_batch._link_batch_product()
lines_without_batch._unlink_batch_product()
diff --git a/sale_order_batch/static/description/index.html b/sale_order_batch/static/description/index.html
index 26b6e56..331fa37 100644
--- a/sale_order_batch/static/description/index.html
+++ b/sale_order_batch/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6686f0672ede8093b17d5d7b165f72f8e49341c7849f9e0d5a162e350fc36d71
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds the possibility to group Sale orders into batches. Attributes of a Sale Order Batch will be written to all
Sale Order. Wenn attached to a batch they can be processed together. On the other hand they cannot be proccesed individual
anymore as log as they are part of a batch. Only Sale Orders in state Qutotation or Quotation Send can be attached to a batch.
@@ -417,10 +417,10 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -439,7 +439,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/sale_order_batch_stock/README.rst b/sale_order_batch_stock/README.rst
index 7e407bb..765f34d 100644
--- a/sale_order_batch_stock/README.rst
+++ b/sale_order_batch_stock/README.rst
@@ -16,9 +16,9 @@ Sale Order Batch Stock Binding
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
-.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github
- :target: https://github.com/bruecksen/ife_nfu/tree/16.0/sale_order_batch_stock
- :alt: bruecksen/ife_nfu
+.. |badge3| image:: https://img.shields.io/badge/github-bruecksen%2Fnfu-lightgray.png?logo=github
+ :target: https://github.com/bruecksen/nfu/tree/16.0/sale_order_batch_stock
+ :alt: bruecksen/nfu
|badge1| |badge2| |badge3|
@@ -37,10 +37,10 @@ Changelog
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues `_.
+Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -60,6 +60,6 @@ Contributors
Maintainers
~~~~~~~~~~~
-This module is part of the `bruecksen/ife_nfu `_ project on GitHub.
+This module is part of the `bruecksen/nfu `_ project on GitHub.
You are welcome to contribute.
diff --git a/sale_order_batch_stock/models/sale_order_batch.py b/sale_order_batch_stock/models/sale_order_batch.py
index ff9a9e8..ef245d2 100644
--- a/sale_order_batch_stock/models/sale_order_batch.py
+++ b/sale_order_batch_stock/models/sale_order_batch.py
@@ -7,8 +7,12 @@ STATES = [("open", "Open"), ("close", "Close")]
class SaleOrderBatch(models.Model):
_inherit = "sale.order.batch"
- picking_ids = fields.Many2many("stock.picking", compute="_compute_picking_ids", string="Transfers")
- delivery_count = fields.Integer(string="Delivery Orders", compute="_compute_picking_ids")
+ picking_ids = fields.Many2many(
+ "stock.picking", compute="_compute_picking_ids", string="Transfers"
+ )
+ delivery_count = fields.Integer(
+ string="Delivery Orders", compute="_compute_picking_ids"
+ )
@api.depends("sale_order_ids.picking_ids")
def _compute_picking_ids(self):
diff --git a/sale_order_batch_stock/static/description/index.html b/sale_order_batch_stock/static/description/index.html
index 515a69f..275e510 100644
--- a/sale_order_batch_stock/static/description/index.html
+++ b/sale_order_batch_stock/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c32b4440b58e98f3bea5539d78dfa2916d64aebc757c140d78b67b2a2ce288da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds Deliverys to Sale ORder Batch Views.
Table of contents
@@ -397,10 +397,10 @@ ul.auto-toc {
-
Bugs are tracked on GitHub Issues.
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -419,7 +419,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
-
This module is part of the bruecksen/ife_nfu project on GitHub.
+
This module is part of the bruecksen/nfu project on GitHub.
You are welcome to contribute.
diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore
new file mode 100644
index 0000000..207e615
--- /dev/null
+++ b/setup/.setuptools-odoo-make-default-ignore
@@ -0,0 +1,2 @@
+# addons listed in this file are ignored by
+# setuptools-odoo-make-default (one addon per line)
diff --git a/setup/README b/setup/README
new file mode 100644
index 0000000..a63d633
--- /dev/null
+++ b/setup/README
@@ -0,0 +1,2 @@
+To learn more about this directory, please visit
+https://pypi.python.org/pypi/setuptools-odoo
diff --git a/setup/nfu_ecommerce/odoo/addons/nfu_ecommerce b/setup/nfu_ecommerce/odoo/addons/nfu_ecommerce
new file mode 120000
index 0000000..ff29825
--- /dev/null
+++ b/setup/nfu_ecommerce/odoo/addons/nfu_ecommerce
@@ -0,0 +1 @@
+../../../../nfu_ecommerce
\ No newline at end of file
diff --git a/setup/nfu_ecommerce/setup.py b/setup/nfu_ecommerce/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_ecommerce/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/nfu_ekg_stock/odoo/addons/nfu_ekg_stock b/setup/nfu_ekg_stock/odoo/addons/nfu_ekg_stock
new file mode 120000
index 0000000..9db7f0f
--- /dev/null
+++ b/setup/nfu_ekg_stock/odoo/addons/nfu_ekg_stock
@@ -0,0 +1 @@
+../../../../nfu_ekg_stock
\ No newline at end of file
diff --git a/setup/nfu_ekg_stock/setup.py b/setup/nfu_ekg_stock/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_ekg_stock/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/nfu_product/odoo/addons/nfu_product b/setup/nfu_product/odoo/addons/nfu_product
new file mode 120000
index 0000000..6f98933
--- /dev/null
+++ b/setup/nfu_product/odoo/addons/nfu_product
@@ -0,0 +1 @@
+../../../../nfu_product
\ No newline at end of file
diff --git a/setup/nfu_product/setup.py b/setup/nfu_product/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_product/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/nfu_product_bnn_attributes/odoo/addons/nfu_product_bnn_attributes b/setup/nfu_product_bnn_attributes/odoo/addons/nfu_product_bnn_attributes
new file mode 120000
index 0000000..7374cee
--- /dev/null
+++ b/setup/nfu_product_bnn_attributes/odoo/addons/nfu_product_bnn_attributes
@@ -0,0 +1 @@
+../../../../nfu_product_bnn_attributes
\ No newline at end of file
diff --git a/setup/nfu_product_bnn_attributes/setup.py b/setup/nfu_product_bnn_attributes/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_product_bnn_attributes/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/nfu_sale_order_batch_packaging/odoo/addons/nfu_sale_order_batch_packaging b/setup/nfu_sale_order_batch_packaging/odoo/addons/nfu_sale_order_batch_packaging
new file mode 120000
index 0000000..01ea95d
--- /dev/null
+++ b/setup/nfu_sale_order_batch_packaging/odoo/addons/nfu_sale_order_batch_packaging
@@ -0,0 +1 @@
+../../../../nfu_sale_order_batch_packaging
\ No newline at end of file
diff --git a/setup/nfu_sale_order_batch_packaging/setup.py b/setup/nfu_sale_order_batch_packaging/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_sale_order_batch_packaging/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/nfu_wholesaler_exporter/odoo/addons/nfu_wholesaler_exporter b/setup/nfu_wholesaler_exporter/odoo/addons/nfu_wholesaler_exporter
new file mode 120000
index 0000000..c7bf97b
--- /dev/null
+++ b/setup/nfu_wholesaler_exporter/odoo/addons/nfu_wholesaler_exporter
@@ -0,0 +1 @@
+../../../../nfu_wholesaler_exporter
\ No newline at end of file
diff --git a/setup/nfu_wholesaler_exporter/setup.py b/setup/nfu_wholesaler_exporter/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/nfu_wholesaler_exporter/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/sale_order_batch/odoo/addons/sale_order_batch b/setup/sale_order_batch/odoo/addons/sale_order_batch
new file mode 120000
index 0000000..80470a0
--- /dev/null
+++ b/setup/sale_order_batch/odoo/addons/sale_order_batch
@@ -0,0 +1 @@
+../../../../sale_order_batch
\ No newline at end of file
diff --git a/setup/sale_order_batch/setup.py b/setup/sale_order_batch/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/sale_order_batch/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/sale_order_batch_stock/odoo/addons/sale_order_batch_stock b/setup/sale_order_batch_stock/odoo/addons/sale_order_batch_stock
new file mode 120000
index 0000000..cf5c737
--- /dev/null
+++ b/setup/sale_order_batch_stock/odoo/addons/sale_order_batch_stock
@@ -0,0 +1 @@
+../../../../sale_order_batch_stock
\ No newline at end of file
diff --git a/setup/sale_order_batch_stock/setup.py b/setup/sale_order_batch_stock/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/sale_order_batch_stock/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/setup/website_decimal_quantity/odoo/addons/website_decimal_quantity b/setup/website_decimal_quantity/odoo/addons/website_decimal_quantity
new file mode 120000
index 0000000..202230f
--- /dev/null
+++ b/setup/website_decimal_quantity/odoo/addons/website_decimal_quantity
@@ -0,0 +1 @@
+../../../../website_decimal_quantity
\ No newline at end of file
diff --git a/setup/website_decimal_quantity/setup.py b/setup/website_decimal_quantity/setup.py
new file mode 100644
index 0000000..28c57bb
--- /dev/null
+++ b/setup/website_decimal_quantity/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)
diff --git a/website_decimal_quantity/controllers/main.py b/website_decimal_quantity/controllers/main.py
index ef0f625..f52d652 100644
--- a/website_decimal_quantity/controllers/main.py
+++ b/website_decimal_quantity/controllers/main.py
@@ -51,21 +51,35 @@ class WebsiteSaleDecimal(WebsiteSale):
values = {}
if access_token:
- abandoned_order = request.env["sale.order"].sudo().search([("access_token", "=", access_token)], limit=1)
+ abandoned_order = (
+ request.env["sale.order"]
+ .sudo()
+ .search([("access_token", "=", access_token)], limit=1)
+ )
if not abandoned_order:
raise NotFound()
if abandoned_order.state != "draft":
values.update({"abandoned_proceed": True})
- elif revive == "squash" or (revive == "merge" and not request.session.get("sale_order_id")):
+ elif revive == "squash" or (
+ revive == "merge" and not request.session.get("sale_order_id")
+ ):
request.session["sale_order_id"] = abandoned_order.id
return request.redirect("/shop/cart")
elif revive == "merge":
- abandoned_order.order_line.write({"order_id": request.session["sale_order_id"]})
+ abandoned_order.order_line.write(
+ {"order_id": request.session["sale_order_id"]}
+ )
abandoned_order.action_cancel()
elif abandoned_order.id != request.session.get("sale_order_id"):
values.update({"access_token": abandoned_order.access_token})
- values.update({"website_sale_order": order, "date": fields.Date.today(), "suggested_products": []})
+ values.update(
+ {
+ "website_sale_order": order,
+ "date": fields.Date.today(),
+ "suggested_products": [],
+ }
+ )
if order:
order.order_line.filtered(lambda l: not l.product_id.active).unlink()
values["suggested_products"] = order._cart_accessories()
@@ -73,7 +87,11 @@ class WebsiteSaleDecimal(WebsiteSale):
if post.get("type") == "popover":
# force no-cache so IE11 doesn't cache this XHR
- return request.render("website_sale.cart_popover", values, headers={"Cache-Control": "no-cache"})
+ return request.render(
+ "website_sale.cart_popover",
+ values,
+ headers={"Cache-Control": "no-cache"},
+ )
return request.render("website_sale.cart", values)
@@ -95,10 +113,14 @@ class WebsiteSaleDecimal(WebsiteSale):
sale_order = request.website.sale_get_order(force_create=True)
if product_custom_attribute_values:
- product_custom_attribute_values = json_scriptsafe.loads(product_custom_attribute_values)
+ product_custom_attribute_values = json_scriptsafe.loads(
+ product_custom_attribute_values
+ )
if no_variant_attribute_values:
- no_variant_attribute_values = json_scriptsafe.loads(no_variant_attribute_values)
+ no_variant_attribute_values = json_scriptsafe.loads(
+ no_variant_attribute_values
+ )
sale_order._cart_update(
product_id=int(product_id),
@@ -145,10 +167,14 @@ class WebsiteSaleDecimal(WebsiteSale):
return {}
if product_custom_attribute_values:
- product_custom_attribute_values = json_scriptsafe.loads(product_custom_attribute_values)
+ product_custom_attribute_values = json_scriptsafe.loads(
+ product_custom_attribute_values
+ )
if no_variant_attribute_values:
- no_variant_attribute_values = json_scriptsafe.loads(no_variant_attribute_values)
+ no_variant_attribute_values = json_scriptsafe.loads(
+ no_variant_attribute_values
+ )
values = order._cart_update(
product_id=product_id,
@@ -167,8 +193,14 @@ class WebsiteSaleDecimal(WebsiteSale):
request.website.sale_reset()
return values
- values["cart_quantity"] = round(sum(order.mapped("website_order_line.product_uom_qty")), 1)
- values["minor_amount"] = (payment_utils.to_minor_currency_units(order.amount_total, order.currency_id),)
+ values["cart_quantity"] = round(
+ sum(order.mapped("website_order_line.product_uom_qty")), 1
+ )
+ values["minor_amount"] = (
+ payment_utils.to_minor_currency_units(
+ order.amount_total, order.currency_id
+ ),
+ )
values["amount"] = order.amount_total
if not display:
@@ -176,9 +208,15 @@ class WebsiteSaleDecimal(WebsiteSale):
values["website_sale.cart_lines"] = request.env["ir.ui.view"]._render_template(
"website_sale.cart_lines",
- {"website_sale_order": order, "date": fields.Date.today(), "suggested_products": order._cart_accessories()},
+ {
+ "website_sale_order": order,
+ "date": fields.Date.today(),
+ "suggested_products": order._cart_accessories(),
+ },
)
- values["website_sale.short_cart_summary"] = request.env["ir.ui.view"]._render_template(
+ values["website_sale.short_cart_summary"] = request.env[
+ "ir.ui.view"
+ ]._render_template(
"website_sale.short_cart_summary", {"website_sale_order": order}
)
return values
@@ -189,5 +227,7 @@ class WebsiteSaleDecimal(WebsiteSale):
This method updates the cart quantity count in the session based on the order's website order lines.
"""
if "website_sale_cart_quantity" not in request.session:
- return request.website.sale_get_order().mapped("website_order_line.product_uom_qty")
+ return request.website.sale_get_order().mapped(
+ "website_order_line.product_uom_qty"
+ )
return request.session["website_sale_cart_quantity"]
diff --git a/website_decimal_quantity/controllers/website_sale_product_configurator.py b/website_decimal_quantity/controllers/website_sale_product_configurator.py
index 9a5d518..8a276f0 100644
--- a/website_decimal_quantity/controllers/website_sale_product_configurator.py
+++ b/website_decimal_quantity/controllers/website_sale_product_configurator.py
@@ -32,7 +32,9 @@ class WebsiteSaleDecimal(WebsiteSale):
"""
@http.route()
- def cart_options_update_json(self, product_and_options, goto_shop=None, lang=None, **kwargs):
+ def cart_options_update_json(
+ self, product_and_options, goto_shop=None, lang=None, **kwargs
+ ):
"""This route is called when submitting the optional product modal.
The product without parent is the main product, the other are
options.
@@ -64,7 +66,9 @@ class WebsiteSaleDecimal(WebsiteSale):
value = order._cart_update(
product_id=main_product["product_id"],
add_qty=main_product["quantity"],
- product_custom_attribute_values=main_product["product_custom_attribute_values"],
+ product_custom_attribute_values=main_product[
+ "product_custom_attribute_values"
+ ],
no_variant_attribute_values=main_product["no_variant_attribute_values"],
**kwargs
)
@@ -78,8 +82,12 @@ class WebsiteSaleDecimal(WebsiteSale):
product_id=option["product_id"],
set_qty=option["quantity"],
linked_line_id=option_parent[parent_unique_id],
- product_custom_attribute_values=option["product_custom_attribute_values"],
- no_variant_attribute_values=option["no_variant_attribute_values"],
+ product_custom_attribute_values=option[
+ "product_custom_attribute_values"
+ ],
+ no_variant_attribute_values=option[
+ "no_variant_attribute_values"
+ ],
**kwargs
)
option_parent[option["unique_id"]] = option_value["line_id"]
diff --git a/website_decimal_quantity/models/sale_order.py b/website_decimal_quantity/models/sale_order.py
index c3589f9..8b58b25 100644
--- a/website_decimal_quantity/models/sale_order.py
+++ b/website_decimal_quantity/models/sale_order.py
@@ -36,10 +36,16 @@ class SaleOrder(models.Model):
to represent it in decimal values
"""
for order in self:
- order.cart_quantity = sum(order.mapped("website_order_line.product_uom_qty"))
- order.only_services = all(line.product_id.type == "service" for line in order.website_order_line)
+ order.cart_quantity = sum(
+ order.mapped("website_order_line.product_uom_qty")
+ )
+ order.only_services = all(
+ line.product_id.type == "service" for line in order.website_order_line
+ )
- def _cart_update(self, product_id, line_id=None, add_qty=0, set_qty=0, **kwargs): # noqa: C901
+ def _cart_update( # noqa: C901
+ self, product_id, line_id=None, add_qty=0, set_qty=0, **kwargs
+ ):
"""Add or set product quantity, add_qty can be negative.
Making add_qty and set_qty integer are avoided in order
@@ -49,12 +55,24 @@ class SaleOrder(models.Model):
if self.state != "draft":
request.session.pop("sale_order_id", None)
request.session.pop("website_sale_cart_quantity", None)
- raise UserError(_("It is forbidden to modify a sales order which is not in draft status."))
+ raise UserError(
+ _(
+ "It is forbidden to modify a sales order which is not in draft status."
+ )
+ )
product = self.env["product.product"].browse(product_id).exists()
if not product or not product._is_add_to_cart_allowed():
- raise UserError(_("The given product does not exist therefore it cannot be added to cart."))
+ raise UserError(
+ _(
+ "The given product does not exist therefore it cannot be added to cart."
+ )
+ )
if product.lst_price == 0 and product.website_id.prevent_zero_price_sale:
- raise UserError(_("The given product does not have a price therefore it cannot be added to cart."))
+ raise UserError(
+ _(
+ "The given product does not have a price therefore it cannot be added to cart."
+ )
+ )
if line_id is not False:
order_line = self._cart_find_product_line(product_id, line_id, **kwargs)[:1]
else:
@@ -78,7 +96,9 @@ class SaleOrder(models.Model):
else:
quantity = add_qty or 0
if quantity > 0:
- quantity, warning = self._verify_updated_quantity(order_line, product_id, quantity, **kwargs)
+ quantity, warning = self._verify_updated_quantity(
+ order_line, product_id, quantity, **kwargs
+ )
else:
# If the line will be removed anyway, there is no need to verify
# the requested quantity update.
@@ -89,18 +109,26 @@ class SaleOrder(models.Model):
order_line = self.env["sale.order.line"]
elif order_line:
# Update existing line
- update_values = self._prepare_order_line_update_values(order_line, quantity, **kwargs)
+ update_values = self._prepare_order_line_update_values(
+ order_line, quantity, **kwargs
+ )
if update_values:
self._update_cart_line_values(order_line, update_values)
elif quantity >= 0:
# Create new line
- order_line_values = self._prepare_order_line_values(product_id, quantity, **kwargs)
+ order_line_values = self._prepare_order_line_values(
+ product_id, quantity, **kwargs
+ )
order_line = self.env["sale.order.line"].sudo().create(order_line_values)
return {
"line_id": order_line.id,
"quantity": quantity,
"option_ids": list(
- set(order_line.option_line_ids.filtered(lambda l: l.order_id == order_line.order_id).ids)
+ set(
+ order_line.option_line_ids.filtered(
+ lambda l: l.order_id == order_line.order_id
+ ).ids
+ )
),
"warning": warning,
}