[18.0][MIG] Migration of subscription_oca to 18.0#1245
[18.0][MIG] Migration of subscription_oca to 18.0#1245
Conversation
105954a to
996eb61
Compare
subscription_oca/data/ir_cron.xml
Outdated
| @@ -0,0 +1,13 @@ | |||
| <?xml version="1.0" encoding="utf-8" ?> | |||
| <odoo> | |||
There was a problem hiding this comment.
This should be noupdate="1" in case of a user change some values (ex: interval fields).
| @@ -0,0 +1,73 @@ | |||
| <?xml version="1.0" encoding="utf-8" ?> | |||
| <odoo> | |||
There was a problem hiding this comment.
noupdate="1". Some values could be edited by a user (prefix, padding etc)
|
|
||
| def _compute_subscription_count(self): | ||
| for record in self: | ||
| record.subscription_count = len(record.subscription_ids) |
There was a problem hiding this comment.
IMO the best is to do a read_group as you did into sale_order.py.
With a single query, you have all data that you need.
| crm_team_id = fields.Many2one(comodel_name="crm.team", string="Sale team") | ||
| to_renew = fields.Boolean(default=False, string="To renew") | ||
|
|
||
| def cron_subscription_management(self): |
| @api.depends("invoice_ids", "sale_order_ids.invoice_ids") | ||
| def _compute_account_invoice_ids_count(self): | ||
| for record in self: | ||
| record.account_invoice_ids_count = len(self.invoice_ids) + len( |
There was a problem hiding this comment.
record instead of self:
record.account_invoice_ids_count = len(record.invoice_ids) + len(record.sale_order_ids.invoice_ids)
| @api.depends("product_ids") | ||
| def _compute_product_ids_count(self): | ||
| for record in self: | ||
| record.product_ids_count = len(self.product_ids) |
There was a problem hiding this comment.
record instead of self:
record.product_ids_count = len(record.product_ids)
996eb61 to
baad433
Compare
|
@acsonefho Thanks!! I've applied your suggestions |
baad433 to
150c702
Compare
Currently translated at 95.7% (159 of 166 strings) Translation: contract-16.0/contract-16.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-subscription_oca/nl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/
Currently translated at 100.0% (163 of 163 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/it/
Currently translated at 92.6% (151 of 163 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/fi/ Added translation using Weblate (Finnish)
Currently translated at 61.3% (100 of 163 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/tr/ Translated using Weblate (Turkish) Currently translated at 58.8% (96 of 163 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/tr/ Added translation using Weblate (Turkish)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/
Currently translated at 100.0% (164 of 164 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/it/
Currently translated at 100.0% (164 of 164 strings) Translation: contract-17.0/contract-17.0-subscription_oca Translate-URL: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-subscription_oca/tr/
150c702 to
54f1d93
Compare
|
I made a mistake with the rebase. |
|
I've reopened the PR here: #1304 |
Continuation of: #1209
Includes:
Apply changes of #1058
Apply changes of #1224
Apply changes of #1210
Apply changes of #1167