Skip to content

Commit

Permalink
changes in the crm_rma module and made it 10.0 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
techspawn committed Jan 11, 2017
1 parent 77a678e commit e20b8e2
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 70 deletions.
6 changes: 4 additions & 2 deletions crm_claim_rma/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo
# © 2015 Eezee-It
# © 2009-2013 Akretion
Expand All @@ -10,6 +11,7 @@
'category': 'Generic Modules/CRM & SRM',
'author': "Akretion, Camptocamp, Eezee-it, MONK Software, Vauxoo, "
"Odoo Community Association (OCA)",
"Techspawn Solutions"
'website': 'http://www.akretion.com, http://www.camptocamp.com, '
'http://www.eezee-it.com, http://www.wearemonk.com, '
'http://www.vauxoo.com',
Expand All @@ -33,12 +35,12 @@
"views/claim_line.xml",
'views/res_partner.xml',
'views/stock_view.xml',
'security/ir.model.access.csv',
#'security/ir.model.access.csv',
],
'demo': [],
'test': [
'test/test_invoice_refund.yml'
],
'installable': False,
'installable': True,
'auto_install': False,
}
3 changes: 2 additions & 1 deletion crm_claim_rma/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import _, api, exceptions, fields, models
from odoo import _, api, exceptions, fields, models


class AccountInvoice(models.Model):
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/account_invoice_line.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import api, models
from odoo import api, models


class AccountInvoiceLine(models.Model):
Expand Down
22 changes: 11 additions & 11 deletions crm_claim_rma/models/claim_line.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
Expand All @@ -10,8 +11,8 @@

from dateutil.relativedelta import relativedelta

from openerp import _, api, exceptions, fields, models
from openerp.tools import (DEFAULT_SERVER_DATE_FORMAT,
from odoo import _, api, exceptions, fields, models
from odoo.tools import (DEFAULT_SERVER_DATE_FORMAT,
DEFAULT_SERVER_DATETIME_FORMAT)

from .invoice_no_date import InvoiceNoDate
Expand Down Expand Up @@ -58,14 +59,14 @@ class ClaimLine(models.Model):
date = fields.Date('Claim Line Date',
select=True,
default=fields.date.today())
name = fields.Char('Description', default='none', required=True,
name = fields.Char('Description', default='none', required=False,
help="More precise description of the problem")
priority = fields.Selection([('0_not_define', 'Not Define'),
('1_normal', 'Normal'),
('2_high', 'High'),
('3_very_high', 'Very High')],
'Priority', default='0_not_define',
compute='_compute_priority',
#compute='_compute_priority',
store=True,
readonly=False,
help="Priority attention of claim line")
Expand All @@ -77,7 +78,7 @@ class ClaimLine(models.Model):
],
help="To describe the line product diagnosis")
claim_origin = fields.Selection(SUBJECT_LIST, 'Claim Subject',
required=True, help="To describe the "
required=False, help="To describe the "
"line product problem")
product_id = fields.Many2one('product.product', string='Product',
help="Returned product")
Expand Down Expand Up @@ -115,20 +116,18 @@ class ClaimLine(models.Model):

@api.model
def get_warranty_return_partner(self):
return self.env['product.supplierinfo']._columns[
'warranty_return_partner'
].selection
return self.env['product.supplierinfo'].warranty_return_partner


warranty_type = fields.Selection(
get_warranty_return_partner, readonly=True,
get_warranty_return_partner,
help="Who is in charge of the warranty return treatment towards "
"the end customer. Company will use the current company "
"delivery or default address and so on for supplier and brand "
"manufacturer. Does not necessarily mean that the warranty "
"to be applied is the one of the return partner (ie: can be "
"returned to the company and be under the brand warranty")
warranty_return_partner = \
fields.Many2one('res.partner', string='Warranty Address',
warranty_return_partner = fields.Many2one('res.partner', string='Warranty Address',
help="Where the customer has to "
"send back the product(s)")
claim_id = fields.Many2one('crm.claim', string='Related claim',
Expand Down Expand Up @@ -278,6 +277,7 @@ def _warranty_limit_values(self, invoice, claim_type, product, claim_date):
'warning': warning}

def set_warranty_limit(self):

self.ensure_one()

claim = self.claim_id
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/crm_claim.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import _, api, exceptions, fields, models
from odoo import _, api, exceptions, fields, models

from .invoice_no_date import InvoiceNoDate
from .product_no_supplier import ProductNoSupplier
Expand Down
1 change: 1 addition & 0 deletions crm_claim_rma/models/invoice_no_date.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/procurement_group.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2016 Cyril Gaudin (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import fields, models
from odoo import fields, models


class ProcurementGroup(models.Model):
Expand Down
1 change: 1 addition & 0 deletions crm_claim_rma/models/product_no_supplier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo
# © 2015 Eezee-It, MONK Software
# © 2013 Camptocamp
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import api, models
from odoo import api, models


class StockMove(models.Model):
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import fields, models
from odoo import fields, models


class StockPicking(models.Model):
Expand Down
3 changes: 2 additions & 1 deletion crm_claim_rma/models/substate_substate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import fields, models
from odoo import fields, models


class SubstateSubstate(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion crm_claim_rma/tests/test_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# © 2016 Cyril Gaudin (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp.tests import TransactionCase
from odoo.tests import TransactionCase


class TestClaim(TransactionCase):
Expand Down
2 changes: 1 addition & 1 deletion crm_claim_rma/tests/test_picking_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# © 2014 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp.tests import common
from odoo.tests import common


class TestPickingCreation(common.TransactionCase):
Expand Down
13 changes: 8 additions & 5 deletions crm_claim_rma/views/account_invoice.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- INHERITED VIEW FOR THE OBJECT : account_invoice -->

<record id="invoice_form" model="ir.ui.view">
Expand All @@ -8,11 +9,13 @@
<field name="inherit_id" ref="account.invoice_form"/>
<field eval="16" name="priority"/>
<field name="arch" type="xml">
<data>
<field name='origin' position="after">
<field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/>
</field>
</data>

<field name='origin' position="after"/>
<xpath expr="//button[@name='action_invoice_cancel']" position="replace">
<field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/>
</xpath>

</field>
</record>
</data>
</odoo>
47 changes: 10 additions & 37 deletions crm_claim_rma/views/claim_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
<separator string="Problem" colspan="4"/>
<group col="6" colspan="4">
<field name="name" colspan="6"/>
<field name="product_id" readonly="1" colspan="6"/>
<!-- Read-only view deleted -->
<field name="product_id" colspan="6"/>
<field name="prodlot_id" colspan="6"/>
<field name="claim_origin" colspan="6"/>
<field name="claim_diagnosis" colspan="6"/>
Expand All @@ -119,26 +120,26 @@
<field name="unit_sale_price"/>
<field name="return_value"/>
</group>
<group>
<group>
<group string="Warranty">
<field name="guarantee_limit" readonly="1"/>
<field name="warning" readonly="1"/>
<field name="warranty_type" readonly="1"/>
<field name="guarantee_limit"/>
<field name="warning"/>
<!-- <field name="warranty_type"/> -->
<field name="warranty_return_partner"/>
</group>
<group string="Linked Document">
<field name="claim_id" readonly="1"/>
<field name="invoice_line_id" readonly="1"/>
<field name="invoice_line_id" />
<field name="refund_line_id" readonly="1"/>
<field name="move_in_id" readonly="1"/>
<field name="move_out_id" readonly="1"/>
</group>
</group>
</group>
<separator string="State" colspan="4"/>
<group col="6" colspan="4">
<field name="substate_id" widget='selection'/>
<field name="last_state_change"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
Expand All @@ -148,34 +149,6 @@
</field>
</record>

<!--
A second slightly modified form view to be used for the claim_line_ids
field in the crm.claim form view. Defining it here instead of directly
inside the field allows us to write only the changes and reference it
-->
<record id="crm_claim_line_view_form_embedded" model="ir.ui.view">
<field name="name">Claim line form view to be used inside claim tree</field>
<field name="mode">primary</field>
<field name="model">claim.line</field>
<field name="priority" eval="30"/>
<field name="inherit_id" ref="crm_claim_line_form_view"/>
<field name="arch" type="xml">
<field name="claim_id" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<field name="product_id" position="attributes">
<attribute name="context">{'claim_id': parent.id, 'company_id': parent.company_id, 'warehouse_id':
parent.warehouse_id, 'claim_type': parent.claim_type, 'claim_date': parent.date}
</attribute>
</field>
<field name="invoice_line_id" position="attributes">
<attribute name="context">{'claim_id': parent.id, 'company_id': parent.company_id, 'warehouse_id':
parent.warehouse_id, 'claim_type': parent.claim_type, 'claim_date': parent.date}
</attribute>
</field>
</field>
</record>

<!-- Claim lines action -->
<record model="ir.actions.act_window" id="act_crm_case_claim_lines">
<field name="name">Claim lines</field>
Expand All @@ -193,7 +166,7 @@
<menuitem
name="Claim lines"
id="menu_crm_case_claims_claim_lines"
parent="base.menu_aftersale"
parent="crm_claim.base_menu_aftersale"
action="act_crm_case_claim_lines"
sequence="2"/>
</odoo>
8 changes: 5 additions & 3 deletions crm_claim_rma/views/crm_claim.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<!-- CLAIM VIEWS -->
<record model="ir.ui.view" id="crm_case_claims_tree_view">
<field name="name">CRM - Claims Tree</field>
Expand Down Expand Up @@ -249,11 +250,10 @@
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='date_deadline']" position="after">
<field name="rma_number"/>
</xpath>
</data>

</field>
</record>

Expand All @@ -277,5 +277,7 @@
<field name="rma_number"/>
</xpath>
</field>
</record>

</record>
</data>
</odoo>
2 changes: 1 addition & 1 deletion crm_claim_rma/wizards/account_invoice_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import api, fields, models
from odoo import api, fields, models


class AccountInvoiceRefund(models.TransientModel):
Expand Down
4 changes: 2 additions & 2 deletions crm_claim_rma/wizards/claim_make_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import time

from openerp import models, fields, exceptions, api, _
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT
from odoo import models, fields, exceptions, api, _
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT


class ClaimMakePicking(models.TransientModel):
Expand Down

0 comments on commit e20b8e2

Please sign in to comment.