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

[12.0][MIG] - Migration module contract to 12.0 #202

Merged
merged 59 commits into from
Oct 29, 2018

Conversation

sbejaoui
Copy link
Contributor

No description provided.

@sbejaoui sbejaoui changed the title [12.0] - Migration module contract to 12.0 [12.0][MIG] - Migration module contract to 12.0 Oct 25, 2018
@sbejaoui sbejaoui changed the title [12.0][MIG] - Migration module contract to 12.0 WIP : [12.0][MIG] - Migration module contract to 12.0 Oct 25, 2018
@sbejaoui sbejaoui changed the title WIP : [12.0][MIG] - Migration module contract to 12.0 [12.0][MIG] - Migration module contract to 12.0 Oct 25, 2018
@sbejaoui sbejaoui mentioned this pull request Oct 25, 2018
19 tasks
@pedrobaeza pedrobaeza added this to the 12.0 milestone Oct 25, 2018
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Welcome to OCA and congratulations for your PRs! They are very well. Just a little suggestion and other warnings in runbot that remarks some problems:

2018-10-25 15:01:38,243 153 WARNING openerp_test odoo.models: The model account.analytic.contract has no _description
2018-10-25 15:01:38,992 153 WARNING openerp_test odoo.addons.base.models.ir_ui_view: The group sale.group_discount_per_so_line defined in view Contract form does not exist!
2018-10-25 15:01:39,058 153 WARNING openerp_test odoo.addons.base.models.ir_ui_view: The group sale.group_discount_per_so_line defined in view account.analytic.account.sale.form does not exist!
2018-10-25 15:01:39,108 153 WARNING openerp_test odoo.addons.base.models.ir_ui_view: The group sale.group_discount_per_so_line defined in view account.analytic.account.purchase.form does not exist!
2018-10-25 15:01:39,253 153 WARNING openerp_test odoo.addons.base.models.ir_ui_view: The group sale.group_discount_per_so_line defined in view Account Analytic Contract Form View does not exist!

contract/tests/test_contract.py Show resolved Hide resolved
@pedrobaeza
Copy link
Member

I think you haven't pushed your changes here.

@sbejaoui
Copy link
Contributor Author

Hi @pedrobaeza,
Thank you for reviewing this PR.

The warning is raised due to the use of sale.group_discount_per_so_line witch is in the sale module and this one is not in the contract module dependencies.

I think, we should use the base.group_no_one instead and add sale.group_discount_per_so_line with inheritance in contract_sale module.

@pedrobaeza
Copy link
Member

I think, we should use the base.group_no_one instead and add sale.group_discount_per_so_line with inheritance in contract_sale module.

OK, Odoo does that with discount field in invoices

pedrobaeza and others added 25 commits October 27, 2018 17:35
If you have contract lines with automatic price and your pricelist
contains different prices per quantity, the price is not changed
when computing quantity.

This PR fixes this.
Bug description
---------------

`account.analytic.contract.line` inherits
`account.analytic.invoice.line`

`account.analytic.invoice.line` defines field `analytic_account_id`:
   - comodel='account.analytic.account'

`account.analytic.contract.line` redefines field `analytic_account_id`:
   - comodel='account.analytic.contract'

On attempt to extend `account.analytic.invoice.line` model adding
field that depends on `analytic_account_id.date_start`
Odoo fails to update, because it adds this field to
`account.analytic.contract.line` through inheritance,
and `account.analytic.contract` model have no this field.

What is done
------------

Change inheritance order:
- `account.analytic.invoice.line` inherits
`account.analytic.contract.line`
- no file renames at this stage (this wil be done in next commit)
In previous commit changed inheritance order of
'account.analytic.*.line' models, thus classes and models were renamed.

This commit only renames files to temporary names.

This commit does not change file contents.
Runbot URL in old README.rst pointed to 10.0 runbot,
fixed by upgrading template
Currently translated at 96.0% (96 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/nl/
Currently translated at 53.0% (53 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/de/
Currently translated at 75.0% (75 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/de/
Currently translated at 98.0% (98 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/es/
Currently translated at 10.0% (10 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/pt_PT/
The test as it was, leaves to the demo pricelist the control on the price of
the product, so other modules that modifies this pricelist will make the
test to fail.

This is the minimum change needed for avoiding the problem.
    - Module: contract
    - Summary: several terms where not translated to Spanish.
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

I have squash a bit the commit history for not dragging non meaningful commits.

Copy link

@gva-acsone gva-acsone left a comment

Choose a reason for hiding this comment

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

Functional test 👍

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Ok, for this simple migration (code review).

I suggest we merge this, so testing of migration of other modules can move forward.

We'll do the refactoring (moving recurrence to contract lines) in another PR.

@pedrobaeza pedrobaeza merged commit cfd42e8 into OCA:12.0 Oct 29, 2018
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