OCA / l10n-brazil

Localização brasileira oficial do Odoo.
https://odoo-community.org/psc-teams/brazil-66
GNU Affero General Public License v3.0
248 stars 247 forks source link

[RFC] Avaliar a possibilidade buscar os dados fiscais através de partner_id.commercial_partner_id #2071

Open marcelsavegnago opened 2 years ago

marcelsavegnago commented 2 years ago

Hoje todos os dados fiscais inclusive os calculos dos impostos dependem diretamente do partner_id.campox , y ou z

Acho que pode ser interessante mudar para partner_id.commercial_partner_id.campox, y ou z

Nativamente se o parceiro tem um parent_id o comercial_partner_id é o parent_id e se nao tem o parent_id o comercial_partner_id é ele mesmo https://github.com/odoo/odoo/blob/a362257ef49a7e074ff2badd5f969777cb2d9585/odoo/addons/base/models/res_partner.py#L293

    @api.depends('is_company', 'parent_id.commercial_partner_id')
    def _compute_commercial_partner(self):
        for partner in self:
            if partner.is_company or not partner.parent_id:
                partner.commercial_partner_id = partner
            else:
                partner.commercial_partner_id = partner.parent_id.commercial_partner_id

Essa mudança vai além do fiscal e mexe tbm no nfe e outros


Referências enviadas pelo Raphael https://www.slideshare.net/RaphalValyi/openerp-contact-id-solution-to-the-contacts-issue-in-v7 https://github.com/OCA/sale-workflow/tree/14.0/sale_commercial_partner https://github.com/OCA/purchase-workflow/tree/14.0/purchase_commercial_partner

rvalyi commented 2 years ago

Realmente @marcelsavegnago , para quem não usa o l10n_br_sale_stock ou o l10n_br_purchase_stock, esse problema pode ser serio. Eu fiz um PR para resolver isso https://github.com/OCA/l10n-brazil/pull/2075

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

mileo commented 1 year ago

Resolvido no https://github.com/OCA/l10n-brazil/pull/2520

antoniospneto commented 11 months ago

@marcelsavegnago conseguiu validar se o #2520 resolve ?

marcelsavegnago commented 11 months ago

@antoniospneto não testei mas é isso ai

github-actions[bot] commented 5 months ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

mileo commented 1 month ago

Podemos fechar esse?