Giter Site home page Giter Site logo

Comments (6)

FrancescoBallerini avatar FrancescoBallerini commented on September 27, 2024 1

Vi segnalo anche questa odoo/odoo#82111.
Qui hanno gestito il problema in mass mailing, non ho trovato la PR aggiornata ma hanno spostato quel pezzo di codice in questo mini metodo https://github.com/odoo/odoo/blob/a8c82e6e4e47d951601364f1714a4150fa63f62a/addons/mail/models/mail_template.py#L70C9-L73, mi chiedevo se fosse già stato valutato questo approccio che coprirebbe anche l'esigenza espressa nella review di @SirTakobi #3337 (comment)

EDIT: aggiorno per completezza, non copre l'esigenza in quanto creiamo gli allegati senza res_id e model_id come già specificato da Marco. Anche adattando la PR all'esigenza:

class FatturaPAAttachmentOut(models.Model):
    _inherit = "fatturapa.attachment.out"

    @api.model
    def create(self, vals):
        attachment = super(FatturaPAAttachmentOut, self).create(vals)
        if attachment.out_invoice_ids:
            attachment.out_invoice_ids.write({'res_model': self._name, 'res_id': attachment.id})
        else:
            attachment.write({'res_model': self._name, 'res_id': -1})
        return attachment

si otterrebbe un workaround simile a quello già suggerito

from l10n-italy.

michelerusti avatar michelerusti commented on September 27, 2024

#3371 per la 16.0

from l10n-italy.

SirTakobi avatar SirTakobi commented on September 27, 2024

Vd. https://github.com/odoo/odoo/blob/e8834cb00b82e0bee7f6338aef940037a3e49471/odoo/addons/base/models/ir_attachment.py#L427-L438

Quindi l'errore sollevato è "Sorry, you are not allowed to access this document."?
Mi pare strano che in un metodo api.model ci sia self, dal commento sembra una parte di codice dedicata solo al test test_01_portal_attachment; hai mica recuperato da dove viene fatta la chiamata (il passo prima dello stacktrace)?

from l10n-italy.

SirTakobi avatar SirTakobi commented on September 27, 2024

@tafaRU hai aggiunto in descrizione un link a questa stessa issue, forse doveva essere un'altra? Magari 3164?

from l10n-italy.

tafaRU avatar tafaRU commented on September 27, 2024

@SirTakobi grazie, corretto.

from l10n-italy.

eLBati avatar eLBati commented on September 27, 2024

Propongo questa soluzione: #3827

from l10n-italy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.