mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
Merge pull request #5 from LeartS/crm_claim_rma-fix-travis-errors
Fix travis errors
This commit is contained in:
@@ -61,7 +61,7 @@ class AccountInvoice(models.Model):
|
||||
elif field_name == 'invoice_line_tax_id':
|
||||
tax_ids = inv_line[field_name].ids
|
||||
clean_line[field_name] = [(6, 0, tax_ids)]
|
||||
clean_line['quantity'] = claim_line['product_returned_quantity']
|
||||
clean_line['quantity'] = claim_line.product_returned_quantity
|
||||
clean_line['claim_line_id'] = [claim_line.id]
|
||||
new_lines.append(clean_line)
|
||||
if not new_lines:
|
||||
|
||||
@@ -248,7 +248,8 @@ class ClaimLine(models.Model):
|
||||
claim = self.claim_id
|
||||
try:
|
||||
values = self._warranty_limit_values(
|
||||
claim.invoice_id, claim.claim_type, self.product_id, claim.date)
|
||||
claim.invoice_id, claim.claim_type,
|
||||
self.product_id, claim.date)
|
||||
except InvoiceNoDate:
|
||||
raise exceptions.Warning(
|
||||
_('Error'), _('Cannot find any date for invoice. '
|
||||
|
||||
@@ -164,6 +164,102 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Crm claim Search view -->
|
||||
<record id="view_crm_case_claims_filter" model="ir.ui.view">
|
||||
<field name="name">CRM - Claims Search</field>
|
||||
<field name="model">crm.claim</field>
|
||||
<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" position="before">
|
||||
<filter string="Sales Team" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'section_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Right side link to orders -->
|
||||
<act_window
|
||||
id="act_crm_claim_rma_sale_orders"
|
||||
name="Quotations and Sales"
|
||||
res_model="sale.order"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to invoices -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'out_invoice')]"
|
||||
id="act_crm_claim_rma_invoice_out"
|
||||
name="Customer Invoices"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to invoices -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'in_invoice')]"
|
||||
id="act_crm_claim_rma_invoice_in"
|
||||
name="Supplier Invoices"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to refunds -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'out_refund')]"
|
||||
id="act_crm_claim_rma_refunds_out"
|
||||
name="Customer Refunds"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to refunds -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'in_refund')]"
|
||||
id="act_crm_claim_rma_refunds_in"
|
||||
name="Supplier Refunds"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to picking in -->
|
||||
<act_window
|
||||
domain="[('picking_type_id.code', '=', 'incoming')]"
|
||||
id="act_crm_claim_rma_picking_in"
|
||||
name="Incoming Shipment and Returns"
|
||||
res_model="stock.picking"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to picking out -->
|
||||
<act_window
|
||||
domain="[('picking_type_id.code', '=', 'outgoing')]"
|
||||
id="act_crm_claim_rma_picking_out"
|
||||
name="Deliveries"
|
||||
res_model="stock.picking"
|
||||
src_model="crm.claim"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_claim.crm_case_categ_claim0">
|
||||
<field name="context">{"search_default_user_id":uid, "stage_type":'claim'}</field>
|
||||
</record>
|
||||
|
||||
<!-- Claim lines action -->
|
||||
<record model="ir.actions.act_window" id="act_crm_case_claim_lines">
|
||||
<field name="name">Claim lines</field>
|
||||
<field name="res_model">claim.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm_claim_line_tree_view"/>
|
||||
<field name="search_view_id" ref="view_crm_claim_lines_filter"/>
|
||||
</record>
|
||||
|
||||
<!-- substates action -->
|
||||
<record id="act_crm_claim_substates" model="ir.actions.act_window">
|
||||
<field name="name">Claim line substates</field>
|
||||
<field name="res_model">substate.substate</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu -->
|
||||
<menuitem
|
||||
name="Claim lines"
|
||||
id="menu_crm_case_claims_claim_lines"
|
||||
parent="base.menu_aftersale"
|
||||
action="act_crm_case_claim_lines"
|
||||
sequence="2"/>
|
||||
<menuitem
|
||||
name="Claim line substates"
|
||||
id="menu_crm_case_claims_claim_line_substates"
|
||||
parent="crm_claim.menu_config_claim"
|
||||
action="act_crm_claim_substates"
|
||||
sequence="2"/>
|
||||
|
||||
<record model="ir.ui.view" id="crm_claim_rma_form_view">
|
||||
<field name="name">CRM - Claim product return Form</field>
|
||||
<field name="model">crm.claim</field>
|
||||
@@ -292,101 +388,5 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Crm claim Search view -->
|
||||
<record id="view_crm_case_claims_filter" model="ir.ui.view">
|
||||
<field name="name">CRM - Claims Search</field>
|
||||
<field name="model">crm.claim</field>
|
||||
<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" position="before">
|
||||
<filter string="Sales Team" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'section_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Right side link to orders -->
|
||||
<act_window
|
||||
id="act_crm_claim_rma_sale_orders"
|
||||
name="Quotations and Sales"
|
||||
res_model="sale.order"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to invoices -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'out_invoice')]"
|
||||
id="act_crm_claim_rma_invoice_out"
|
||||
name="Customer Invoices"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to invoices -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'in_invoice')]"
|
||||
id="act_crm_claim_rma_invoice_in"
|
||||
name="Supplier Invoices"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to refunds -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'out_refund')]"
|
||||
id="act_crm_claim_rma_refunds_out"
|
||||
name="Customer Refunds"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to refunds -->
|
||||
<act_window
|
||||
domain="[('type', '=', 'in_refund')]"
|
||||
id="act_crm_claim_rma_refunds_in"
|
||||
name="Supplier Refunds"
|
||||
res_model="account.invoice"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to picking in -->
|
||||
<act_window
|
||||
domain="[('picking_type_id.code', '=', 'incoming')]"
|
||||
id="act_crm_claim_rma_picking_in"
|
||||
name="Incoming Shipment and Returns"
|
||||
res_model="stock.picking"
|
||||
src_model="crm.claim"/>
|
||||
<!-- Right side link to picking out -->
|
||||
<act_window
|
||||
domain="[('picking_type_id.code', '=', 'outgoing')]"
|
||||
id="act_crm_claim_rma_picking_out"
|
||||
name="Deliveries"
|
||||
res_model="stock.picking"
|
||||
src_model="crm.claim"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_claim.crm_case_categ_claim0">
|
||||
<field name="context">{"search_default_user_id":uid, "stage_type":'claim'}</field>
|
||||
</record>
|
||||
|
||||
<!-- Claim lines action -->
|
||||
<record model="ir.actions.act_window" id="act_crm_case_claim_lines">
|
||||
<field name="name">Claim lines</field>
|
||||
<field name="res_model">claim.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm_claim_line_tree_view"/>
|
||||
<field name="search_view_id" ref="view_crm_claim_lines_filter"/>
|
||||
</record>
|
||||
|
||||
<!-- substates action -->
|
||||
<record id="act_crm_claim_substates" model="ir.actions.act_window">
|
||||
<field name="name">Claim line substates</field>
|
||||
<field name="res_model">substate.substate</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu -->
|
||||
<menuitem
|
||||
name="Claim lines"
|
||||
id="menu_crm_case_claims_claim_lines"
|
||||
parent="base.menu_aftersale"
|
||||
action="act_crm_case_claim_lines"
|
||||
sequence="2"/>
|
||||
<menuitem
|
||||
name="Claim line substates"
|
||||
id="menu_crm_case_claims_claim_line_substates"
|
||||
parent="crm_claim.menu_config_claim"
|
||||
action="act_crm_claim_substates"
|
||||
sequence="2"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -55,7 +55,8 @@ class ClaimMakePicking(models.TransientModel):
|
||||
warehouse_id = self.env.context.get('warehouse_id')
|
||||
|
||||
if picking_type == 'out' and warehouse_id:
|
||||
return self.env['stock.warehouse'].browse(warehouse_id).lot_stock_id
|
||||
return self.env['stock.warehouse'].browse(
|
||||
warehouse_id).lot_stock_id
|
||||
|
||||
if partner_id:
|
||||
partner = self.env['res.partner'].browse(partner_id)
|
||||
@@ -130,7 +131,7 @@ class ClaimMakePicking(models.TransientModel):
|
||||
return {
|
||||
'origin': claim.code,
|
||||
'picking_type_id': picking_type.id,
|
||||
'move_type': 'one', # direct
|
||||
'move_type': 'one', # direct
|
||||
'state': 'draft',
|
||||
'date': time.strftime(DT_FORMAT),
|
||||
'partner_id': partner_id,
|
||||
|
||||
Reference in New Issue
Block a user