Community mailing list archives

community@mail.odoo.com

Re: one2many qweb report display

by
Luke Branch
- 09/06/2015 20:14:27
Hi,

Please show the full code including the full loop code for the report you're trying to create (t-foreach t-as, etc.), as this will help troubleshoot and figure out what is going wrong.

For what you are trying to accomplish (image on sale order line, and customised reports) I suggest considering Aeroo Reports. This will allow you to 'print' reports in XLS, ODS, ODF, PDF, CSV, and other format so you are not just limited to PDF/HTML as you currently are using the built-in QWeb reports.

There's an install script here that will install Odoo + Aeroo Reports for development purposes if you're interested in taking a look:


I've attached a sample quotation/saleorder template report (in ODS format to allow for conversion to XLS with Aeroo Reports) as a demonstration/howto for getting started if you're interested.

On Mon, Sep 7, 2015 at 1:44 AM, moulay rachid Hachimi <moulayrachidhachimi@gmail.com> wrote:
thanks luck

the problem that i'm having is this

i'm having pictures that i want  to print in sale.oder report

basicly i did this

 <span t-field="o.product_id.images.image" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>

this works if i have one pictur per product but if i have more than one

i got this message



File "/home/odoo/odoo/openerp/fields.py", line 1768, in __get__
    return record.ensure_one()._ids[0]
  File "/home/odoo/odoo/openerp/models.py", line 5196, in ensure_one
    raise except_orm("ValueError", "Expected singleton: %s" % self)
QWebException: ('ValueError', 'Expected singleton: product.image(6, 8, 7)')

On Sun, Sep 6, 2015 at 5:34 PM, Luke Branch <odoocommunitywidgets@gmail.com> wrote:
without any details of what you've tried it's difficult to know where you went wrong. Take a look at this post, it might help you understand:

https://www.odoo.com/forum/help-1/question/how-do-you-use-variables-in-a-qweb-loop-67687

On Mon, Sep 7, 2015 at 12:58 AM, moulay rachid Hachimi <moulayrachidhachimi@gmail.com> wrote:
i did the loop but did not work

On Sun, Sep 6, 2015 at 4:22 PM, Luke Branch <odoocommunitywidgets@gmail.com> wrote:
Hi,

you need a foreach loop. Check out the QWeb documentation here:



Regards,

Luke

On 6 Sep, 2015, at 11:53 pm, moulay rachid Hachimi <moulayrachidhachimi@gmail.com> wrote:

hi 

how to display one2many field in qweb reports

thanks you

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
212654039440


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe