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

[FIX] sale_order_type: Incompatibility with l10n_latam_check module #3550

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 11 additions & 5 deletions sale_order_type/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@
move.invoice_payment_term_id = move.sale_type_id.payment_term_id
return res

@api.depends("sale_type_id")
def _compute_journal_id(self):
res = super()._compute_journal_id()
for move in self.filtered("sale_type_id.journal_id"):
move.journal_id = move.sale_type_id.journal_id
def _search_default_journal(self):
res = super()._search_default_journal()
sale_type_journal_id = self.sale_type_id.journal_id
if sale_type_journal_id and sale_type_journal_id in self.suitable_journal_ids:
return sale_type_journal_id

Check warning on line 55 in sale_order_type/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

sale_order_type/models/account_move.py#L55

Added line #L55 was not covered by tests
return res

@api.onchange("sale_type_id")
def _onchange_sale_type_id(self):
sale_type_journal_id = self.sale_type_id.journal_id
if sale_type_journal_id and sale_type_journal_id in self.suitable_journal_ids:
self.journal_id = sale_type_journal_id.id

Check warning on line 62 in sale_order_type/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

sale_order_type/models/account_move.py#L62

Added line #L62 was not covered by tests
Loading