mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[REM] Cleanup
This commit is contained in:
@@ -38,9 +38,6 @@
|
|||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
],
|
],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
# 'test': [
|
|
||||||
# 'test/test_invoice_refund.yml'
|
|
||||||
# ],
|
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class ClaimLine(models.Model):
|
|||||||
|
|
||||||
_inherit = 'mail.thread'
|
_inherit = 'mail.thread'
|
||||||
_description = "List of product to return"
|
_description = "List of product to return"
|
||||||
# _rec_name = "display_name"
|
|
||||||
|
|
||||||
SUBJECT_LIST = [('none', 'Not specified'),
|
SUBJECT_LIST = [('none', 'Not specified'),
|
||||||
('legal', 'Legal retractation'),
|
('legal', 'Legal retractation'),
|
||||||
@@ -71,7 +70,6 @@ class ClaimLine(models.Model):
|
|||||||
('2_high', 'High'),
|
('2_high', 'High'),
|
||||||
('3_very_high', 'Very High')],
|
('3_very_high', 'Very High')],
|
||||||
'Priority', default='0_not_define',
|
'Priority', default='0_not_define',
|
||||||
# compute='_compute_priority',
|
|
||||||
store=True,
|
store=True,
|
||||||
readonly=False,
|
readonly=False,
|
||||||
help="Priority attention of claim line")
|
help="Priority attention of claim line")
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
-
|
|
||||||
In order to test the refund creation from a claim
|
|
||||||
-
|
|
||||||
I create a customer invoice
|
|
||||||
-
|
|
||||||
!record {model: account.invoice, id: account_invoice_claim_refund}:
|
|
||||||
payment_term_id: account.account_payment_term_advance
|
|
||||||
partner_id: base.res_partner_3
|
|
||||||
name: 'Test Customer Invoice'
|
|
||||||
invoice_line_ids:
|
|
||||||
- product_id: product.product_product_5
|
|
||||||
quantity: 10.0
|
|
||||||
- product_id: product.product_product_4
|
|
||||||
quantity: 5.0
|
|
||||||
-
|
|
||||||
I confirm the invoice
|
|
||||||
-
|
|
||||||
!python {model: account.invoice, id: account_invoice_claim_refund}: |
|
|
||||||
self.action_invoice_open()
|
|
||||||
-
|
|
||||||
I create a claim
|
|
||||||
-
|
|
||||||
!record {model: crm.claim, id: claim_refund}:
|
|
||||||
name: 'Angry Customer'
|
|
||||||
claim_type: crm_claim_type.crm_claim_type_customer
|
|
||||||
partner_id: base.res_partner_3
|
|
||||||
invoice_id: account_invoice_claim_refund
|
|
||||||
stage_id: crm_claim.stage_claim1
|
|
||||||
-
|
|
||||||
I prepare the wizard context.
|
|
||||||
-
|
|
||||||
!python {model: account.invoice.refund}: |
|
|
||||||
claim_lines = self.env['claim.line'].search([('claim_id','=',ref('claim_refund'))])
|
|
||||||
context.update({'active_model': 'crm_claim', 'active_id': ref('claim_refund'), 'claim_id': ref('claim_refund'), 'invoice_ids': [ref('account_invoice_claim_refund')] })
|
|
||||||
-
|
|
||||||
I create a refund wizard
|
|
||||||
-
|
|
||||||
!record {model: account.invoice.refund, id: wizard_claim_refund}:
|
|
||||||
filter_refund: refund
|
|
||||||
description: 'claim refund'
|
|
||||||
-
|
|
||||||
I launch the refund wizard
|
|
||||||
-
|
|
||||||
!python {model: account.invoice.refund}: |
|
|
||||||
self.compute_refund([ref('wizard_claim_refund')], 'refund', context=context)
|
|
||||||
-
|
|
||||||
I check that a refund linked to the claim has been created.
|
|
||||||
-
|
|
||||||
!python {model: account.invoice}: |
|
|
||||||
refund = self.search([('type', '=', 'out_refund'),('claim_id', '=', ref('claim_refund'))])
|
|
||||||
assert refund, "The refund is created"
|
|
||||||
refund_line_ids = self.env['account.invoice.line'].search([('invoice_id','=',refund[0])])
|
|
||||||
assert len(refund_line_ids) == 2, "It contains 2 lines, as excepted"
|
|
||||||
refund_lines = self.env['account.invoice.line'].browse(refund_line_ids)
|
|
||||||
assert ref('product.product_product_4') in [refund_lines[0].product_id.id, refund_lines[1].product_id.id], "First line is checked"
|
|
||||||
assert ref('product.product_product_5') in [refund_lines[0].product_id.id, refund_lines[1].product_id.id], "Second line is checked"
|
|
||||||
Reference in New Issue
Block a user