monthlylastday is (almost) not a special case anymore \o/.
montlylastday is simply a montly period where the
periods are aligned on month boundaries.
The last bit of special casing is that postpaid generates
invoice the day after the last dasy of the period, except
for monthlylastday where the invoice is generated on the
last day of the period. This last exception will disappear
when we put the offset under user control.
This is a breaking change because the post-paid/pre-paid
mode becomes relevant for monthlylastday invoicing.
The field becomes visible in the UI. Code that generate
monthlylastday contract lines must now correctly set
the pre-paid/post-paid mode too. Some tests have had
to be adapted to reflect that.
The lowest model access for contract.contract model is group_account_invoice group. However the addon adds two smart buttons to res.partner view without any security restrictions and without compute_sudo attribute on computed fields.
This causes the view to crash when a user without the proper permissions tries to access the res.partner form view.
The solution adds groups_id to the partner form views in which the buttons are added, so the only loads when the user has proper permissions.
Other way to solve it would be to add compute_sudo attribute to the relevant fields, but this causes an access error when the user clicks on the smart buttons.
* Remove incorrect oldname attributes.
* Add filter on partners for running contracts (+ a support o2m field for that).
* Cover more tables in model renaming + cleaner code using a loop.
* Don't copy contract lines, but rename table + copy contract records on pre.
* Contract code is now populated to "Reference/Description" field in invoice.
* Order on new contract model has been restored to the same as old analytic accounts.
[RMV] - Remove empty file
[IMP] - Update no_update cron after migration
[IMP] - move contract template recurrence info to line level
[FIX] - Fix contract line model description
[IMP] - Link contracts to analytic accounts
[FIX] - Fix pylint
[IMP] - Move chatter and attachments from analytic account to contract
[IMP] - Move account_analytic_id to contract line level
[IMP] - Improve version check in migration script
[IMP] - Move contracts followers from analytic accounts
[ADD] - Add mail.activity.mixin to contract.contract model
remove data drop from migration scripts
[12.0][FIX] - Fix _init_last_date_invoiced
fix flake8
[ADD] - Update contributors list
[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
[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
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
[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
[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
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
* company_id was empty because an onchange, not inheritance nor visibility
* Added multi-company group to company_id fields
* Added multi-company access rule to contract templates
* Fix double %% in XML dates that was causing an error
* When creating a contract, recurring_invoices is set by default
* Correct domain attribute in field journal_id
Original domain includes unknown value company_id. Throws error when selecting the journal.
* Corregidos errores detectados por Lint
* Refactoring, DRY
* [FIX] Add missing field company_id to account_analytic_contract
* Small refactoring for company_id field
* [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
**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