Merge lp://qastaging/~cmsa/openerp.pt-br-localiz/fiscal_position_is_of_type_integer into lp://qastaging/~openerp-brazil-core-team/openerp.pt-br-localiz/openerp.pt-br-localiz-v7.0

Proposed by Carlos Almeida
Status: Merged
Approved by: Renato Lima - http://www.akretion.com
Approved revision: 545
Merged at revision: 545
Proposed branch: lp://qastaging/~cmsa/openerp.pt-br-localiz/fiscal_position_is_of_type_integer
Merge into: lp://qastaging/~openerp-brazil-core-team/openerp.pt-br-localiz/openerp.pt-br-localiz-v7.0
Diff against target: 23 lines (+8/-3)
1 file modified
l10n_br_sale/sale.py (+8/-3)
To merge this branch: bzr merge lp://qastaging/~cmsa/openerp.pt-br-localiz/fiscal_position_is_of_type_integer
Reviewer Review Type Date Requested Status
Renato Lima - http://www.akretion.com Pending
Review via email: mp+169698@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2013-06-12.

Description of the change

Corrigi o bug 1190267, validando também a existência do shop na empresa

To post a comment you must log in.
Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) wrote : Posted in a previous version of this proposal

Olá Carlos,

Obrigado pela contribuição, eu apenas faria a seguinte modificação:

def _default_fiscal_category(self, cr, uid, context=None):
        result = False
        shop_id = context.get("shop_id", self.default_get(
            cr, uid, ["shop_id"], context)["shop_id"])
        if shop_id:
            shop = self.pool.get("sale.shop").read(
            cr, uid, [shop_id], ["default_fc_id"])
            if shop[0]["default_fc_id"]:
                result = shop[0]["default_fc_id"][0]
        return result

Porque seria interessante conferir se existe o shop_id (o que hoje também não faz) caso uma empresa não tenha ainda um shop criado o código anterior também geraria um bug

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.