Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhehe1995 authored and AungKoKoLin1997 committed Jul 4, 2024
1 parent 33ef756 commit 85e7871
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.19.2
_commit: '1.23'
_src_path: https://github.com/OCA/oca-addons-repo-template.git
ci: GitHub
convert_readme_fragments_to_markdown: true
Expand All @@ -13,7 +13,7 @@ github_enforce_dev_status_compatibility: false
include_wkhtmltopdf: false
odoo_test_flavor: OCB
odoo_version: 10.0
org_name: Quartile Limited
org_name: ''
org_slug: qrtl
rebel_module_groups: []
repo_description: ''
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ var/
*.egg
*.eggs

# Debian packages
*.deb

# Redhat packages
*.rpm

# MacOS packages
*.dmg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down
2 changes: 2 additions & 0 deletions .oca_hooks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MESSAGES_CONTROL]
disable=xml-deprecated-data-node,xml-deprecated-tree-attribute
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Quartile Limited
; manifest_required_authors=
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
Expand Down Expand Up @@ -103,7 +103,7 @@ enable=anomalous-backslash-in-string,
eval-referenced,
license-allowed,
manifest-author-string,
manifest-required-author,
; manifest-required-author,
manifest-required-key,
manifest-version-format,
api-one-deprecated,
Expand Down
4 changes: 2 additions & 2 deletions .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ score=n

[ODOOLINT]
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest_required_authors=Quartile Limited
<!-- manifest_required_authors= -->
manifest_required_keys=license
manifest_deprecated_keys=description,active
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
Expand Down Expand Up @@ -57,7 +57,7 @@ enable=anomalous-backslash-in-string,
eval-referenced,
license-allowed,
manifest-author-string,
manifest-required-author,
<!-- manifest-required-author, -->
manifest-required-key,
manifest-version-format

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This part will be replaced when running the oca-gen-addons-table script from OCA

This repository is licensed under [AGPL-3.0](LICENSE).

However, each module can have a totally different license, as long as they adhere to Quartile Limited
However, each module can have a totally different license, as long as they adhere to
policy. Consult each module's `__manifest__.py` file, which contains a `license` key
that explains its license.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def name_search(self, name='', args=None, operator='ilike', limit=100):
('value_ids', operator, name)
] # QTL add
search_result = self.search(expression.AND([domain, args]), limit=limit)
return search_result.name_get() # QTL add
if search_result:
return search_result.name_get() # QTL add

return super(ProductAttributeLine, self).name_search(
name=name, args=args, operator=operator, limit=limit
)
Expand Down
1 change: 1 addition & 0 deletions product_procurement_plan/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'version': '10.0.1.2.0',
'category': 'Product',
"author": "Quartile Limited",
'website': 'https://www.quartile.co',
"license": "AGPL-3",
"depends": [
"purchase",
Expand Down
8 changes: 6 additions & 2 deletions product_procurement_plan/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@ def _compute_proc_lt_adj(self):
@api.multi
def _compute_qty_variance(self):
for product in self:
product.qty_suggested = product.avg_qty_adj * product.proc_lt_adj
product.qty_variance = product.qty_available + product.incoming_qty - product.qty_suggested
product.qty_suggested = (
product.avg_qty_adj * product.proc_lt_adj
)
product.qty_variance = (
product.qty_available + product.incoming_qty - product.qty_suggested
)
26 changes: 18 additions & 8 deletions product_procurement_plan/wizard/product_procurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def _get_sorted_parent_products(self, products):
bom_line_products = [product for product in bom_line_products]
# Add lower-level products in the stack according to the BOM structure.
for product in bom_line_products:
bom_lines = self.env["mrp.bom.line"].search([("product_id", "=", product.id)])
bom_lines = self.env["mrp.bom.line"].search(
[("product_id", "=", product.id)]
)
if not bom_lines and product not in sorted_parent_products:
sorted_parent_products += product
for bom_line in bom_lines:
Expand Down Expand Up @@ -118,7 +120,7 @@ def _update_qty_dict(self, qty_dict, sorted_parent_products, adjust=False):
Note that qty_dict gets updated with new elements as the loop proceeds
"""
for prod in sorted_parent_products:
if not prod.id in qty_dict:
if prod.id not in qty_dict:
continue
bom = self.env["mrp.bom"]._bom_find(product=prod)
for line in bom.bom_line_ids:
Expand Down Expand Up @@ -198,7 +200,7 @@ def _get_leadtime_data(self, sorted_products):
produce_products += product
bom = self.env["mrp.bom"]._bom_find(product=product)
for line in bom.bom_line_ids:
if not line.product_id in sorted_products:
if line.product_id not in sorted_products:
sorted_products.append(line.product_id)
return buy_prod_dict, produce_products

Expand Down Expand Up @@ -229,8 +231,12 @@ def _update_lt_info_from_moves(self, moves, lt_accum, num_recs):
@api.model
def _update_lt_info_from_invoice_lines(self, invoice_lines, lt_accum, num_recs):
for line in invoice_lines:
date_invoice = datetime.strptime(line.invoice_id.date_invoice, DATE_FORMAT)
order_date = datetime.strptime(line.purchase_line_id.order_id.date_order, DATETIME_FORMAT)
date_invoice = datetime.strptime(
line.invoice_id.date_invoice, DATE_FORMAT
)
order_date = datetime.strptime(
line.purchase_line_id.order_id.date_order, DATETIME_FORMAT
)
lt_accum += (date_invoice - order_date).days
num_recs += 1
return lt_accum, num_recs
Expand All @@ -245,9 +251,13 @@ def _update_buy_prod_procure_lt(self, buy_prod_dict, from_date):
lt_accum = 0.0
num_recs = 0
if product.type == "service":
invoice_lines = self.env["account.invoice.line"].search(
[("product_id", "=", product.id), ("purchase_line_id", "!=", False)]
).filtered(lambda x: x.invoice_id.state in ("open", "paid") and x.invoice_id.date_invoice >= from_date)
invoice_lines = self.env["account.invoice.line"].search([
("product_id", "=", product.id),
("purchase_line_id", "!=", False)
]).filtered(
lambda x: x.invoice_id.state in ("open", "paid")
and x.invoice_id.date_invoice >= from_date
)
lt_accum, num_recs = self._update_lt_info_from_invoice_lines(
invoice_lines, lt_accum, num_recs
)
Expand Down
1 change: 1 addition & 0 deletions sale_partner_additional_info/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions setup/fix_product_attribute_line_name_search/setup.py

This file was deleted.

0 comments on commit 85e7871

Please sign in to comment.