[REM] account,account_edi_ubl_cii: remove context key

The account_predictive_bills module is merged into account_accountant.
With this change, the context key
`account_predictive_bills_disable_prediction` is not used anymore.

closes odoo/odoo#104625

Related: odoo/upgrade#3918
Related: odoo/enterprise#31640
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Pierrot (prro)
2023-01-13 16:27:00 +01:00
parent 1f4fb64a19
commit b49769841a
4 changed files with 4 additions and 7 deletions
+1 -3
View File
@@ -375,7 +375,7 @@ class AccountTestInvoicingCommon(TransactionCase):
def init_invoice(cls, move_type, partner=None, invoice_date=None, post=False, products=None, amounts=None, taxes=None, company=False):
move_form = Form(cls.env['account.move'] \
.with_company(company or cls.env.company) \
.with_context(default_move_type=move_type, account_predictive_bills_disable_prediction=True))
.with_context(default_move_type=move_type))
move_form.invoice_date = invoice_date or fields.Date.from_string('2019-01-01')
# According to the state or type of the invoice, the date field is sometimes visible or not
# Besides, the date field can be put multiple times in the view
@@ -398,8 +398,6 @@ class AccountTestInvoicingCommon(TransactionCase):
for amount in (amounts or []):
with move_form.invoice_line_ids.new() as line_form:
line_form.name = "test line"
# We use account_predictive_bills_disable_prediction context key so that
# this doesn't trigger prediction in case enterprise (hence account_predictive_bills) is installed
line_form.price_unit = amount
if taxes:
line_form.tax_ids.clear()
@@ -151,7 +151,7 @@ class TestAccountMoveInInvoiceOnchanges(AccountTestInvoicingCommon):
@freeze_time('2021-09-16')
def test_in_invoice_onchange_invoice_date_2(self):
invoice_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice', account_predictive_bills_disable_prediction=True))
invoice_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice'))
invoice_form.partner_id = self.partner_a
invoice_form.invoice_payment_term_id = self.env.ref('account.account_payment_term_30days')
with invoice_form.invoice_line_ids.new() as line_form:
@@ -3787,7 +3787,7 @@ class TestAccountMoveReconcile(AccountTestInvoicingCommon):
self.env.company.tax_exigibility = True
# Create an invoice with a CABA tax using 'Include in analytic cost'
move_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice', account_predictive_bills_disable_prediction=True))
move_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice'))
move_form.invoice_date = fields.Date.from_string('2019-01-01')
move_form.partner_id = self.partner_a
self.cash_basis_tax_a_third_amount.analytic = True
@@ -4000,7 +4000,7 @@ class TestAccountMoveReconcile(AccountTestInvoicingCommon):
self.tax_account_1.reconcile = True
# Create an invoice with a CABA tax using 'Include in analytic cost'
move_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice', account_predictive_bills_disable_prediction=True))
move_form = Form(self.env['account.move'].with_context(default_move_type='in_invoice'))
move_form.invoice_date = fields.Date.from_string('2019-01-01')
move_form.partner_id = self.partner_a
@@ -262,7 +262,6 @@ class AccountEdiCommon(models.AbstractModel):
return
with (existing_invoice or self.env['account.move']).with_context(
account_predictive_bills_disable_prediction=True,
default_move_type=move_type,
default_journal_id=journal.id,
)._get_edi_creation() as invoice: