Browse Source
[IMP] - Make one migration from 12.0.1 to 12.0.4
[IMP] - Make one migration from 12.0.1 to 12.0.4
[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 listpull/207/head
sbejaoui
5 years ago
12 changed files with 357 additions and 230 deletions
-
30contract/migrations/12.0.2.0.0/post-migration.py
-
92contract/migrations/12.0.2.0.0/pre-migration.py
-
16contract/migrations/12.0.3.0.0/post-migration.py
-
308contract/migrations/12.0.4.0.0/post-migration.py
-
103contract/migrations/12.0.4.0.0/pre-migration.py
-
4contract/models/account_invoice.py
-
11contract/models/contract.py
-
10contract/models/contract_line.py
-
3contract/readme/CONTRIBUTORS.rst
-
0contract/views/account_invoice_view.xml
-
4contract/views/contract.xml
-
6contract/views/contract_line.xml
@ -1,30 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Copyright 2018 ACSONE SA/NV |
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
import logging |
|
||||
from odoo import SUPERUSER_ID, api |
|
||||
|
|
||||
|
|
||||
_logger = logging.getLogger(__name__) |
|
||||
|
|
||||
|
|
||||
def migrate(cr, version): |
|
||||
"""Copy recurrence info from contract to contract lines and compute |
|
||||
last_date_invoiced""" |
|
||||
_logger.info(">> Post-Migration 12.0.2.0.0") |
|
||||
cr.execute( |
|
||||
"""UPDATE account_analytic_invoice_line AS contract_line |
|
||||
SET recurring_rule_type=contract.recurring_rule_type, |
|
||||
recurring_invoicing_type=contract.recurring_invoicing_type, |
|
||||
recurring_interval=contract.recurring_interval, |
|
||||
recurring_next_date=contract.recurring_next_date, |
|
||||
date_start=contract.date_start, |
|
||||
date_end=contract.date_end |
|
||||
FROM account_analytic_account AS contract |
|
||||
WHERE contract.id=contract_line.contract_id""" |
|
||||
) |
|
||||
env = api.Environment(cr, SUPERUSER_ID, {}) |
|
||||
contract_lines = env["account.analytic.invoice.line"].search( |
|
||||
[("recurring_next_date", "!=", False)] |
|
||||
) |
|
||||
contract_lines._init_last_date_invoiced() |
|
@ -1,16 +0,0 @@ |
|||||
# Copyright 2019 ACSONE SA/NV |
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
||||
|
|
||||
import logging |
|
||||
|
|
||||
from odoo import SUPERUSER_ID, api |
|
||||
|
|
||||
_logger = logging.getLogger(__name__) |
|
||||
|
|
||||
|
|
||||
def migrate(cr, version): |
|
||||
_logger.info(">> Post-Migration 12.0.3.0.0") |
|
||||
_logger.info("Populate invoicing partner field on contracts") |
|
||||
env = api.Environment(cr, SUPERUSER_ID, {}) |
|
||||
contracts = env["account.analytic.account"].search([]) |
|
||||
contracts._inverse_partner_id() |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue