Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Recursively load the template objects and create the real objects in openerp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 215
    Comment on it

    To Recursively load the template objects and create the real objects in openerp show detail given below.
    1-param company: company the wizard is running for
    2-param code_digits: number of digits the accounts code should have in the COA
    3-param transfer_account_id: reference to the account template that will be used as intermediary account for transfers between 2 liquidity accounts
    4-param obj_wizard: the current wizard for generating the COA from the templates
    5-param acc_ref: Mapping between ids of account templates and real accounts created from them
    6-param taxes_ref: Mapping between ids of tax templates and real taxes created from them
    7-returns: tuple with a dictionary containing
    * the mapping between the account template ids and the ids of the real accounts that have been generated from them, as first item,
    * a similar dictionary for mapping the tax templates and taxes, as second item.
    Use this code given below in .py file in openerp

    1. def _install_template(self, company, code_digits=None, transfer_account_id=None, obj_wizard=None, acc_ref=None, taxes_ref=None):
    2. """ Recursively load the template objects and create the real objects from them.
    3.  
    4.  
    5. self.ensure_one()
    6. if acc_ref is None:
    7. acc_ref = {}
    8. if taxes_ref is None:
    9. taxes_ref = {}
    10. if self.parent_id:
    11. tmp1, tmp2 = self.parent_id._install_template(company, code_digits=code_digits, transfer_account_id=transfer_account_id, acc_ref=acc_ref, taxes_ref=taxes_ref)
    12. acc_ref.update(tmp1)
    13. taxes_ref.update(tmp2)
    14. tmp1, tmp2 = self._load_template(company, code_digits=code_digits, transfer_account_id=transfer_account_id, account_ref=acc_ref, taxes_ref=taxes&_ref)
    15. acc_ref.update(tmp1)
    16. taxes_ref.update(tmp2)
    17. return acc_ref, taxes_ref

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: