-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
[13.0] [MIG] partner_multi_relation #913
Conversation
* API of _auto_init * Menu and groups stuff has moved from base to sales_team in odoo 10
* Fix error on search when leaf is (1, '=', 1) * Another comparison fix with search arguments
* Update README * Python 2to3 * Move relation menus items under contacts * Fix date comparison * Fix cache invalidate on relation write * Bump module version * Remove test_relation_type_unlink_dberror This test is not required because it tests a standard behavior of SQL. If a foreign key column is not nullable, then the foreign row can not be deleted. * Remove utf8 encoding comment * Add missing dependency for partner_multi_relation * Add missing active_test in view action
* Bug Fix * Enable additional columns on res_partner_relation_all. Enable to add additional columns from res_partner_relation in the sql view of res_partner_relation_all. * Only require inverse_name when relation type is not symmetric * Remove deprecated @api.one and replace openerp with odoo * Add website to manifest * Prevent disabling allow_self if reflexive relations exist * Enable deleting/ending invalid relations after deactivating reflexivity. * Handle case of invalid future reflexive relations
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: partner-contact-12.0/partner-contact-12.0-partner_multi_relation Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_multi_relation/
Currently translated at 86.6% (84 of 97 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_multi_relation Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_multi_relation/es/
[IMP] Flake8
Currently translated at 46.4% (45 of 97 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_multi_relation Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_multi_relation/it/
Currently translated at 99.0% (96 of 97 strings) Translation: partner-contact-12.0/partner-contact-12.0-partner_multi_relation Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_multi_relation/it/
I'd need some help/guidelines on how to port self.env.do_in_draft() so that the tests pass. The bug with smart button is getting partially correct patch so that should be OK somewhat. |
Hi, do_in_draft() no longer exists. I think it will be best to remove it (and unindent the lines under it). The intention of do_in_draft according to the 12.0 documentation was to change things only in cache. It probably will not matter, as changes in test environment are rolled back anyway. |
I think do_in_draft() can be replaced by protecting : https://github.com/odoo/odoo/blob/13.0/odoo/api.py#L647 |
@Rad0van is the hint given by @rousseldenis enough for you to make the needed adjustments? |
@NL66278 I don't know how to use protecting. Without it when using without do_in_draft() tests fail for me. Don't know if it's the result of using model.Model instead of model.AbstractModel So to summarize it's probably above my current (very limited) knowledge and skills. Would love to help though. |
@BT-shautz if you do what rousseldenis suggested about do_in_draft() (simply use the code without it) do your tests pass? If so I'd be happy to close this one in favor of yours. |
At the moment I haven't gone so far. |
@BT-shautz the colors are fine - great to know how to do that. The important thing is whether the automatic tests will pass. Without that it can be hardly expected it will be allowed to be merged. For me it didn't work so far. |
If you remove the "with self.env.do_in_draft():" and run the tests what errors do you get? Maybe I can help you there. |
I'll let you know in more detail. But generally attributes were not containing expected values so some of the tests (esp. the one previously running in do_in_draft()) were failing. |
@Rad0van I looked into the semantics of protecting and I have to say the proper use or workings of it are completely dark to me as well. It is only used by Odoo internally in the fields.py and models.py python modules. As far as I can see its purpose there is to prevent recomputation of some field values. So I would also advise to just leave out the do_in_draft calls, and if any problem crops up, we deal with it in another way. |
@NL66278 You can see now the tests fail on asserts. My guess would be this is not really due to removal of do_in_draft() but more because of changing class ResPartnerRelation(models.AbstractModel) into class ResPartnerRelation(models.Model) in res_partner_relation.py Without that change the module fails on transitive dependencies as described in #877 Maybe using TransientModel would solve this? Update: it wouldn't... |
As the original developer of this module I feel a duty to help resolving this. I have planned to do this starting next monday. Thanks for all attempts so far! |
@NL66278 thanx a lot. I remade this module into product_multi_relation and currently have opened PR here: OCA/product-attribute#605 However @rousseldenis asks for some substantial changes and also some questions I am not able to answer in a good way. If you'd be so kind and have a look and maybe provide some guidance. Originally I wanted to keep the source as close to the original partner_multi_relation to be able to transfer changes from there. So I am a bit hesitant to start big changes. Would you please have a look there as well? |
@NL66278 not at all. Thank you very much. If you could maybe have a look at OCA/product-attribute#605 and provide some guidance / advice. Thanx again. |
OK, this is my second attempt at porting this to 13.0 Followed the guide for porting that @pedrobaeza and @NL66278 pointed to to my best abilities.
There are few things that are not finished though:
<record id="tree_res_partner_relation_all" model="ir.ui.view"> <field name="model">res.partner.relation.all</field> <field name="arch" type="xml"> <tree string="Partner Relations" colors="gray:not active; blue:date_start > current_date" editable="top" >
Didn't know how to find proper replacement. Help needed here.with self.env.do_in_draft():
used in tests/test_partner_relation.py and tests/test_partner_relation_all.py fails tests. Also don't know hot to replace this and with what.Also ran into the same issue as #877 Solved by changing
class ResPartnerRelation(models.AbstractModel)
intoclass ResPartnerRelation(models.Model)
in res_partner_relation.py Is that correct?Any suggestions are welcome.