← Back to team overview

openerp-community-reviewer team mailing list archive

Re: lp:~akretion-team/account-invoicing/70-add-invoice_fiscal_position_update into lp:account-invoicing

 

The way I discovered this function was when reviewing account_voucher
code in 6.1 which manually implemented the resolve_2many functionality
but in 7.0 did not.

My better idea would be to cut and paste the v7 command, either using
an osv.orm.resolve2many = statement for the previously defined
function (i.e. make it an ORM method) or just making it an
account.invoice method and see if it works.  I would be surprised if
it didn't just work for you with a straight cut and paste.  Failing
that - revert to "update" approach, but it is not a major if you don't
want to.

On Wed, Jan 8, 2014 at 12:39 PM, Alexis de Lattre <alexis@xxxxxxxxxx> wrote:
> Just a quick note about what I discovered while trying to backport the module to OpenERP 6.1 : the ORM function resolve_2many_commands exists in OpenERP 6.1 under a different name : resolve_o2m_commands_to_record_dicts
>
> But, unfortunately, when trying to use it, I often get :
>
> File "/home/alexis/new_boite/dev/server-61/openerp/osv/orm.py", line 4975, in resolve_o2m_commands_to_record_dicts
>     "Only CREATE, UPDATE and LINK_TO commands are supported in resolver"
>
> When you look at the code of this function in openerp 6.1 in openerp/osv/orm.py, you see that it only handles commands 0, 1 and 4 ; whereas the same code in OpenERP 7.0 handles 0, 1, 2, 3, 4, 5 and 6.
>
> During my tests, I got a command "6", so I hit the assert and it crashes.
>
> So, if you don't have a better idea, a backport to OpenERP 6.1 of this module would probably use the "update" button approach.
> --
> https://code.launchpad.net/~akretion-team/account-invoicing/70-add-invoice_fiscal_position_update/+merge/200358
> You are reviewing the proposed merge of lp:~akretion-team/account-invoicing/70-add-invoice_fiscal_position_update into lp:account-invoicing.

-- 
https://code.launchpad.net/~akretion-team/account-invoicing/70-add-invoice_fiscal_position_update/+merge/200358
Your team Account Core Editors is subscribed to branch lp:account-invoicing.


References