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

[MIG] crm_claim_rma #128

Merged
merged 9 commits into from Jun 25, 2019
Merged

[MIG] crm_claim_rma #128

merged 9 commits into from Jun 25, 2019

Conversation

max3903
Copy link
Sponsor Member

@max3903 max3903 commented Oct 24, 2017

@max3903 max3903 added this to the 10.0 milestone Oct 24, 2017
@max3903 max3903 self-assigned this Oct 24, 2017
@max3903 max3903 mentioned this pull request Oct 24, 2017
@pedrobaeza pedrobaeza mentioned this pull request Oct 24, 2017
10 tasks
@flotho
Copy link
Member

flotho commented Nov 14, 2017

Hi everyone,
This one seems to be blocked. Any chance to be reviewed?

regards

@flotho
Copy link
Member

flotho commented Nov 21, 2017

Still blocked?

@max3903
Copy link
Sponsor Member Author

max3903 commented Nov 25, 2017

@flotho #126 needs to be merged first.

@DipSwitch
Copy link

I merged crma_claim_rma_code and this module in my source code, howerver I get the following error when I'm trying to install the plugin:

ParseError: "Error while validating constraint

Element '<xpath expr="//button[@name='action_invoice_cancel']">' cannot be located in parent view

Error context:
View `invoice.form.cancel.inherit`
[view_id: 1064, xml_id: account_cancel.invoice_form_cancel_inherit, model: account.invoice, parent_id: 725]
None" while parsing /opt/odoo/custom/addons/crm_claim_rma/views/account_invoice.xml:5, near
<record id="invoice_form" model="ir.ui.view">
		<field name="name">crm_claim_rma.invoice_form</field>
		<field name="model">account.invoice</field>
		<field name="inherit_id" ref="account.invoice_form"/>
		<field name="priority" eval="16"/>
		<field name="arch" type="xml">
			<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>

		</data></field>
	</record>

What I don't understand because when I look at the view it is as followed:

<?xml version="1.0"?>
<form string="Invoice">
            <header>
                <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                <button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                <button name="300" type="action" states="open" string="Register Payment" groups="account.group_account_invoice" class="oe_highlight"/>
                <button name="action_invoice_open" type="object" states="draft" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
                <button name="action_invoice_open" type="object" states="proforma2" string="Validate" groups="account.group_account_invoice"/>
                <button name="action_invoice_proforma2" type="object" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
                <button name="363" type="action" string="Refund Invoice" groups="account.group_account_invoice" attrs="{'invisible': ['|',('type', '=', 'out_refund'), ('state', 'not in', ('open','proforma2','paid'))]}"/>
                <button name="action_invoice_cancel" type="object" states="draft,proforma2,open" string="Cancel Invoice" groups="base.group_no_one"/>
                <button name="action_invoice_draft" states="cancel" string="Reset to Draft" type="object" groups="account.group_account_invoice"/>
                <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid"/>
            </header>
			...
            </form>

I tried enabling Allow Cancelling Entries on all journals but this didn't have any affect.
After removing account_cancel I got a bit further (I think)

ParseError: "External ID not found in the system: crm_claim.base_menu_aftersale" while parsing /opt/odoo/custom/addons/crm_claim_rma/views/claim_line.xml:171, near
<menuitem name="Claim lines" id="menu_crm_case_claims_claim_lines" parent="crm_claim.base_menu_aftersale" action="act_crm_case_claim_lines" sequence="2"/>

Which I than changed to:

    <!-- Menu -->
<menuitem
        name="Claim lines"
        id="menu_crm_case_claims_claim_lines"
        parent="crm_claim.menu_aftersale"
        action="act_crm_case_claim_lines"
        sequence="2"/>

Then I got:

Exception: Module loading crm_claim_rma failed: file crm_claim_rma/security/ir.model.access.csv could not be processed:
 No matching record found for external id 'base.group_sale_salesman_all_leads' in field 'Group'
 No matching record found for external id 'base.group_sale_salesman_all_leads' in field 'Group'
 No matching record found for external id 'base.group_sale_manager' in field 'Group'
 No matching record found for external id 'base.group_sale_manager' in field 'Group'
 No matching record found for external id 'base.group_sale_salesman' in field 'Group'
 No matching record found for external id 'base.group_sale_salesman' in field 'Group'

Which i fixed with:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_substate_user_all_leads,substate.substate.user,model_substate_substate,sales_team.group_sale_salesman,1,1,1,0
access_claim_line_user_all_leads,claim.line.user,model_claim_line,sales_team.group_sale_salesman,1,1,1,0
access_substate_manager,substate.substate.manager,model_substate_substate,sales_team.group_sale_manager,1,1,1,1
access_claim_line_manager,claim.line.manager,model_claim_line,sales_team.group_sale_manager,1,1,1,1
access_substate_user,substate.substate.user,model_substate_substate,sales_team.group_sale_salesman,1,1,1,0
access_claim_line_user,claim.line.user,model_claim_line,sales_team.group_sale_salesman,1,1,1,0

I Can't find the repository to make the pull request on...

# © 2015 Vauxoo
# © 2015 Eezee-It
# © 2009-2013 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'RMA Claim (Product Return Management)',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Generic Modules/CRM & SRM',
'author': "Akretion, Camptocamp, Eezee-it, MONK Software, Vauxoo, "
"Odoo Community Association (OCA)",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, is in the wrong place

return self.env['product.supplierinfo']._columns[
'warranty_return_partner'
].selection
return self.env['product.supplierinfo'].warranty_return_partner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to: self.env['product.supplierinfo'].fields_get('warranty_return_partner')['warranty_return_partner']['selection'] and you are golden. Will test the rest tomorrow.

@DipSwitch
Copy link

wizard/claim_make_picking.py: s/'name': line.product_id.name_template/'name': line.product_id.name/gi

@ Line 135 & 235

I however can't change the state of the Claim Line. However this is the first time I'm working with this plugin :p

@DipSwitch
Copy link

Any way I can help with this module?

@max3903 max3903 force-pushed the 10.0_crm_claim branch 4 times, most recently from 68da72e to 31dafdb Compare April 12, 2018 13:33
Maxime Chambreuil and others added 2 commits April 12, 2018 08:55
# Conflicts:
#	crm_claim_rma/wizards/claim_make_picking.py
@max3903 max3903 force-pushed the 10.0_crm_claim branch 3 times, most recently from 470db17 to 6d97cf5 Compare April 12, 2018 16:13
@Cedric-Pigeon
Copy link

@max3903 Hi, could you tell me if the PR is usable as this or not ? and eventually what we can do to end it ? Thanks

@max3903
Copy link
Sponsor Member Author

max3903 commented Nov 19, 2018

@Cedric-Pigeon I don't remember :(

@emagdalenaC2i emagdalenaC2i mentioned this pull request Dec 29, 2018
12 tasks
@max3903
Copy link
Sponsor Member Author

max3903 commented May 23, 2019

@Cedric-Pigeon @DipSwitch @flotho I was not able to restart runbot.

I propose you 2 options:

  1. You can test and review and I fix eventual errors to merge the pull request.
  2. I close the pull request.

@kenvac
Copy link

kenvac commented Jun 3, 2019

I am available to offer my help on this task.

@rousseldenis
Copy link
Sponsor

@max3903 I've relaunched runbot.
There is a warning when loading crm_claim_rma/data/crm_team.xml :

WARNING openerp_test odoo.models: crm.team.create() includes unknown fields: code

@max3903 max3903 requested a review from rousseldenis June 3, 2019 19:10
Copy link
Sponsor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some comments

crm_claim_rma/__manifest__.py Outdated Show resolved Hide resolved
crm_claim_rma/models/claim_line.py Outdated Show resolved Hide resolved
crm_claim_rma/models/claim_line.py Outdated Show resolved Hide resolved
@max3903 max3903 requested a review from kenvac June 4, 2019 13:54
Copy link

@kenvac kenvac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good. I have few comments to make.

Change openerp.py to manifest.py

The licence is in the file __openerp__.py

Change OpenERP to Odoo

crm_claim_rma for OpenERP

Do we really need copy method. Can't we use copy=False at fields level?

def copy(self, default=None):

Add _compute_priority to test case

def _compute_priority(self):

method _get_subject not used anywhere

def _compute_line_total_amount(self):

Add set_warranty_limit to test case

def set_warranty_limit(self):

Add method set_warranty to test case

def set_warranty(self):

Add _compute_display_name to test case

def _compute_display_name(self):

@rafaelbn
Copy link
Member

/ocabot merge

@OCA-git-bot
Copy link
Contributor

Sorry @rafaelbn you do not have push permission, so I can't merge for you.

@max3903
Copy link
Sponsor Member Author

max3903 commented Jun 25, 2019

/ocabot merge

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Rebased to 10.0-ocabot-merge-pr-128-by-max3903-bump-no, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Merge command aborted due to a failed check on 10.0-ocabot-merge-pr-128-by-max3903-bump-no.

@max3903 max3903 merged commit cee44c3 into OCA:10.0 Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants