Commit Graph

46 Commits

Author SHA1 Message Date
Stéphane Bidoul (ACSONE)
562e775bdf [REF] contract: handle max_date_end in _get_recurring_next_date
This concentrates all next date calculation
logic in one place, and will allow further simplifications.
2020-07-13 18:26:42 +02:00
Stéphane Bidoul (ACSONE)
a27f377c85 [REF] contract: rename misnamed methods 2020-07-13 18:26:42 +02:00
Pedro M. Baeza
8ecd8bbc95 [FIX] contract: Tests with duplicated name
So they are not executed at all. Detected by chance looking for a test for the other PR.
2020-07-13 18:26:42 +02:00
Sergio Teruel
8976dcfcb4 [IMP] contract: Fix test crash with other modules 2020-07-13 18:26:42 +02:00
Thomas Binsfeld
1169382b18 [REF] Contract Sale Invoicing: split from analytic account
[REF] Contract Sale Invoicing: update translations

[IMP] - Assert that the predecessor is available for new link at uncancel

[RMV] - remove usless changes

[RMV] - Remove usless field recurring_invoices

after the total isolation between contract model and account analytic one.
recurring_invoices which was used to mark analytic account as contract became usless

[IMP] - P3 syntax

[IMP] - use @openupgrade.migrate() and openupgrade.logged_query

[IMP] - drop transient table in migration script
2020-07-13 18:26:41 +02:00
Thomas Binsfeld
fff9eac579 [REF] Contract: split from analytic account 2020-07-13 18:26:41 +02:00
sbejaoui
80c6866709 [IMP] - A canceled contract line can't be set to auto-renew
[REF] Contract: pep8

[IMP] Contract: update USAGE section of README

[IMP]call onchange_is_auto_renew when changing template
2020-07-13 18:26:41 +02:00
sbejaoui
d5c94e74bd [FIX] - don't play onchange date_start for old lines on contract template change
[FIX] - Fix stop post message

[FIX] - Fix sale_contract_count should count all partner contract

[FIX] - set recurring_next_date to False if contract line stoped at last date invoiced

[FIX] - Group by next_invoice also considers dates in the past
2020-07-13 18:26:41 +02:00
sbejaoui
c139f2d734 [FIX] - Onchange contract line don't reste contract lines
[FIX] - Rename _get_invoiced_period to _get_period_to_invoice

[ADD] - Add stop_at_date_end to _get_period_to_invoice

[FIX] - Remove useless filter
2020-07-13 18:26:41 +02:00
sbejaoui
b1fc4cb781 [REF] - add method to get quantity to invoice
the contract line quantity can be in some use cases variable, to simplify
the way it is changed we add a new method _get_quantity_to_invoice.
2020-07-13 18:26:41 +02:00
Thomas Binsfeld
1a04a391ae [FIX] Contract to Invoice: take contract vendor instead of partner's 2020-07-13 18:26:41 +02:00
sbejaoui
707334f739 [ADD] - Add more value for auto_renew_rule_type
[REF] - refactoring for compute_first_date_end

[RMV] - remove auto_renew_rule_type option monthlylastday

[IMP] - rename manual_renew_needed label

[IMP] - use get_product_multiline_description_sale to get contract line description
2020-07-13 18:26:41 +02:00
sbejaoui
ae8ebc3496 [IMP] - Should be able to stop a past contract line 2020-07-13 18:26:41 +02:00
sbejaoui
51fb72803b [IMP] - Replace is_suspended flag by manual_renew_needed
Add a computed field for the first date of the termination notice period

Adapt state compute and search method

[IMP] - Improve unit tests
2020-07-13 18:26:41 +02:00
sbejaoui
8b0398abc9 [IMP] - Link invoice line to contract lines
[IMP] - Add index on contract line

[IMP] - Add is_suspended flag and _search_state

[IMP] - Add is_suspended flag to stop contract line
2020-07-13 18:26:41 +02:00
sbejaoui
431163b150 [FIX] - filter by termination_notice for contract line to renew 2020-07-13 18:26:41 +02:00
sbejaoui
433b8fa3fa [12.0][IMP] - check invoice line vals before assignment
[FIX] - Fix unit tests.
2020-07-13 18:26:41 +02:00
sbejaoui
7866eece2b [FIX] - default value for active field in contract line
[FIX] - fix flake8
2020-07-13 18:26:41 +02:00
sbejaoui
0632b4b90e [FIX] - as date_start is required, constraints on it become useless
[FIX] - for finished contract _get_lines_to_invoice should return False
2020-07-13 18:26:41 +02:00
Thomas Binsfeld
77e13cc292 [REF] Contract: invoice creation
[FIX] - Fix typo

[IMP] - date start required for contract line

[REF] Gitignore: .eggs

[REF] Contract Unit Tests: base the cron check on invoice lines instead of invoices
2020-07-13 18:26:34 +02:00
sbejaoui
5a1d443f06 [FIX] - contract recurring_next_date ignore canceled lines
[FIX] - fix _get_invoiced_period if recurring_next_date manually updated
2020-07-13 18:23:49 +02:00
sbejaoui
76c8d413b9 [IMP] - don't allow to unlink uncnaceled contrac line 2020-07-13 18:23:49 +02:00
sbejaoui
86dfdb14c5 [IMP] - store last_date_invoiced on contract_line
Improve CRITERIA_ALLOWED_DICT

[IMP] - code improvement

[IMP] - Use last_date_invoiced to set marker in invoice description

[IMP] - add migration script to init last_day_invoiced and some other improvement

[FIX] - a contract line suspended should start a day after the suspension end
2020-07-13 18:23:49 +02:00
sbejaoui
92c1c837c6 [IMP] - hide recurring_invoicing_type if recurring_rule_type is monthlylastday
for the monthlylastday case, pre-paid is logicly impossible,
if monthlylastday is set, we consider only post-paid case

[IMP] - Improve unit tests
2020-07-13 18:23:49 +02:00
sbejaoui
01e3e0fe44 [IMP] - improve cancel/uncancel process
[FIX] - Test if start_date is set before compute

[FIX] - date_end include in the period in auto_renew case

[FIX] - in suspension case, contract line should start a day after the end

[IMP] - confirm message on contract line cancel
2020-07-13 18:23:49 +02:00
sbejaoui
e920654ecf [FIX] - fix stop_plan_successor case 5
contract line start in the suspension period and end after it
2020-07-13 18:23:49 +02:00
sbejaoui
ae7bb3fdc5 [IMP] - Add primary views for contract
[IMP] - don't use related filed for partner_id and pricelist_id
2020-07-13 18:23:49 +02:00
sbejaoui
d6db72995f [FIX] - invoice last period for post-paid case 2020-07-13 18:23:49 +02:00
sbejaoui
c716e7ab39 [12.0][IMP] - Add strat/stop wizard to contract line
[12.0][IMP] - Add pause button to contract line

[IMP] - Add state filed in contract line form

[FIX] - stop don't change date_end for finished contract line

[IMP] - Change contract line buttons visibility

Add renewal process with termination notice

[FIX] - don't consider stop_date If it is after the contract line end_date

[IMP] - consider more cases in stop_plan_successor

[IMP] - cancel upcoming line on stop

[IMP] - Chnage next invoice date on un-cancel

[IMP] - Post message in contract on contract line actions

[IMP] - check contract line overlap
2020-07-13 18:23:49 +02:00
sbejaoui
f785d3ae76 [IMP] - Make recurrence mechanism on contract line
Make recurrence mechanism on contract line and some other refactoring

[FIX] - Keep contract_cron on account_analytic_account model

contract_cron defined with no_update option.
Changing it, will cause issue to past version installation.

[IMP] - Fix recurring_next_date default value

recurring_next_date should have start_date as default value in prepaid policy
and start_date + invoicing_interval if postpaid

[FIX] - Fix test check no journal

[IMP] - Return created invoices on recurring_create_invoice

[IMP] - Specific process to compute recurring_next_date for  monthly-last-day

fixes: #198

[ADD] - Add Post-migration script to bring recurrence info from contract to contract lines

[ADD] - Add search filter based on date_end and recurring_next_date

 - not_finished filter in contract search view
 - finished filter in contract search view
 - Next Invoice group by in contract search view

[ADD] - Add unit tests

- cases to compute first recurring next date
- contract recurring_next_date
- contract date_end

[IMP] - Improve Unit tests
2020-07-13 18:23:49 +02:00
sbejaoui
134a3dd232 [MIG] contract: Migration to 12.0 2020-07-13 18:23:49 +02:00
Pedro M. Baeza
c29b5b20f6 [IMP] contract: Don't depend on external data
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.
2020-07-13 17:02:57 +02:00
mreficent
55d74ded63 [IMP] Make sure it works for sale and purchase contracts 2020-07-13 17:02:57 +02:00
Stefan Becker
f9cd8e8d61 [IMP] Add type to analytic account / contract 2020-07-13 17:02:57 +02:00
Carlos Dauden
416a05a259 [IMP] contract: Add extend existing invoice possibility 2020-07-13 17:02:57 +02:00
Pedro M. Baeza
b0778770c7 [IMP] contract: Automatic prices for lines 2020-07-13 17:02:57 +02:00
Pedro M. Baeza
f29a7152b2 [10.0][FIX+IMP] contract: Improve usability and don't fail on wrong data (#130)
* [FIX+IMP] contract: Improve usability and don't fail on wrong data

* Cron create invoices masked for avoiding silent errors
* New constraints for assuring data consistency
* UI helps for entering consistent data
* Spanish translation
* Remove double company_id field on form
2020-07-13 17:02:57 +02:00
Fekete Mihai
602be97a4d [MIG] contract: Migration to version 11.0 2020-07-13 17:02:57 +02:00
Carlos Dauden
c2f64438ac [IMP] contract: Module contract improvements (#107) 2020-07-13 17:02:57 +02:00
Pedro M. Baeza
92d86a1a5a [FIX] contract: fix views assignment + improvement on tests + copyright in headers
**Be totally deterministic about which views to use**

Having a primary view that is not explicitly declared to be uses and w/o priority
makes Odoo to choose between one of them randomly (well, not exactly, but kind of),
so we put here which views to use.

I have also put tree view as primary and put a large priority for not being
selected on other actions that don't have this explicit views.

A friendly name in views is also assigned.

**Improvements in tests**

* Use SavepointCase for making the setup only once for all tests
* Make them inheritable, creating a base class with only the setup,
  so that it can be inherited without the need of executing all tests
  contained here each time you inherit it, and adding other class
  in the same module that inherits from the base class that actually
  performs the tests.
* Removed duplicated test method
2020-07-13 17:02:57 +02:00
Dave Lasley
55b57e7d23 [FIX] contract: Template lines handling (#92)
Update contract template lines handling to fix #80, and fix #59 #100
2020-07-13 17:02:57 +02:00
cubells
87fc4f1b66 [IMP][10.0] contract: Add report + send by mail (#86)
* [IMP][9.0] contract: Add report + send by mail

* Update translation and rename contract report

* Changes requested and translation updated
2020-07-13 17:02:57 +02:00
Dave Lasley
051c2b7550 [IMP][10.0] contract: Add templating (#42)
Add template functionality for contracts
2020-07-13 17:02:57 +02:00
Pedro M. Baeza
27ce8702ad [MIG] contract: Migration to version 10.0 2020-07-13 17:02:57 +02:00
Carlos Dauden
fc00f8e531 [IMP] contract: Add past receipt type. Fix yearly. Add month last day 2020-07-13 17:02:57 +02:00
Carlos Incaser
08ffee2c82 [MIG] contract: from v7 to v9 improving features
* Tests added
* Filters added.
* Add _id/_ids in old property fields
* Translations
2020-07-13 17:02:57 +02:00