Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FIX] l10n_do_accounting: TypeError: AccountMove._name_search() got an unexpected keyword argument 'order' #1183

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_do_accounting/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Localization",
"license": "LGPL-3",
"website": "https://github.com/odoo-dominicana",
"version": "17.0.1.0.2",
"version": "17.0.1.0.3",
"countries": ["do"],
# any module necessary for this one to work correctly
"depends": ["l10n_latam_invoice_document", "l10n_do"],
Expand Down
14 changes: 4 additions & 10 deletions l10n_do_accounting/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@
WHERE (l10n_latam_document_type_id IS NOT NULL
AND move_type NOT IN ('in_invoice', 'in_refund'))
AND l10n_do_fiscal_number <> '';

Check warning on line 176 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

blank line contains whitespace

Check warning on line 176 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

blank line contains whitespace
CREATE UNIQUE INDEX account_move_unique_l10n_do_fiscal_number_purchase_manual
ON account_move(l10n_do_fiscal_number, commercial_partner_id, company_id)
WHERE (l10n_latam_document_type_id IS NOT NULL AND move_type IN ('in_invoice', 'in_refund')
AND l10n_latam_manual_document_number = 't')
AND l10n_do_fiscal_number <> '';

Check warning on line 182 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

blank line contains whitespace

Check warning on line 182 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

blank line contains whitespace
CREATE UNIQUE INDEX account_move_unique_l10n_do_fiscal_number_purchase_internal
ON account_move(l10n_do_fiscal_number, company_id)
WHERE (l10n_latam_document_type_id IS NOT NULL AND move_type IN ('in_invoice', 'in_refund', 'in_receipt')

Check failure on line 185 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

line too long (121 > 120 characters)

Check failure on line 185 in l10n_do_accounting/models/account_move.py

View workflow job for this annotation

GitHub Actions / flake8

line too long (121 > 120 characters)
AND l10n_latam_manual_document_number = 'f')
AND l10n_do_fiscal_number <> '';
"""
Expand All @@ -190,20 +190,14 @@
return super()._auto_init()

@api.model
def _name_search(
self, name="", args=None, operator="ilike", limit=100, name_get_uid=None
):
args = args or []
domain = []
def _name_search(self, name, domain=None, operator='ilike', limit=None, order=None):
if name:
domain = [
domain = expression.AND([[
"|",
("name", operator, name),
("l10n_do_fiscal_number", operator, name),
]
return self._search(
expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid
)
], domain])
return super()._name_search(name, domain, operator, limit, order)

def _l10n_do_is_new_expiration_date(self):
self.ensure_one()
Expand Down
Loading