How to insert parent logo on Quotation/Order report? - odoo

I'm trying to insert the logo of my client on the "Quotation/Order" report. I already got to insert the logo of the contacts of the clients using the code below on the report_saleorder_document view:
<img t-if="doc.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>
The problem is: the logo is not present on the partner_id, but it is stored on the parent.partner_id
I already tried the code below, but not working.
<img t-if="doc.parent.partner_id.image_256" t-attf-src="data:image/*;base64,{{doc.parent.partner_id.image_256}}" class="img img-responsive" alt="User Image"/>
Any suggestion?

I got it by myself... thanks Saks_here!
1 - enter developer mode
2 - Menu Technical/User Interface/Views
3 - Find the views you need to duplicate (in my case report_saleorder and report_saleorder_document)
4 - Enter on the view and click in Action/Duplicate and change the "view name" on the top of the screen and laso the t-name on the Archetecture
5 - Menu Technical/Sequence & Identifiers/External Identifires
6 - Find the External Idendifiers you want to duplicate (i used a new browser tab to facilitate copy and paste the info)
7 - Click on Create and views, changing the "external identifier" to the name you need
8 - using a database query, find the id of the views you have created on step 4
9 - go back to the identifiers you have cretaed and replace the "record id" with the id you got on step 8
10 - Menu Technical/Actions/Reports
11 - CLick on the report you want to duoplicate
12 - Click in Action/Duplicate and chenge: Name, Template Name and Printed Report Name and save it
13 - click in Qweb views, you will finde the reports you have created
14 - modify the reports using the archtecture tab

In sale, while clicking on partner_id, you will have partner's name and its parent company's name. If you want to show the logo of parent company in sale Quotation or order report,
Code:
<img style="height:2cm;width:2cm;" t-if="doc.partner_id.parent_id.image_256" t-attf-src="data:image/*;base64,{{doc.partner_id.parent_id.image_256}}" class="img img-responsive" alt="User Image"/>

Related

Linking to a specific part of a page - Vuejs

I have a route that is built which properly appends #fans at the end of the link...
http://localhost:3000/.../community#fans
I also have id set for fans in the below code (third line)
1) Even though the link is properly filled when a button is clicked (the address in the address bar is the address as shown above), it does not actually go to the part of the page with id fans.
2) But if I go to http://localhost:3000/.../community first and then type #fans at the end of the link, that works. If i remove the id, #fans does not work so I think the code below is fine.
Given #2, I don't understand why #1 is an issue especially since the link that works is the same link that gets generated for the button. Is there a reason why it would work when manually entering the id tag but not when generated?
<panelWithTopTitleAndOptionalTopButton
class="panelWithCards our-fans"
id="fans"
:class="{ hasNoCards: !fans || !fans.length }"
:name="fansTitle"
v-if="!!fansTitle">
<transition-group name="list" tag="div">
<memberCard class="card fan"
v-for="fan in fans"
v-if="!!fan"
:card="fan"
#delete-member="onDeleteMemberPosition"
type="fans"
:key="fan.key" />
</transition-group>
<div
v-if="showLoadMoreButton"
class="load-more"
#click="loadMore"
>LOAD MORE</div>
</panelWithTopTitleAndOptionalTopButton>

Prestashop how to make modification on Add and Minus button in shopping cart

who knows what file controls the function for add and minus button in the shopping cart? I want to change the qty that is added or minus after any buttons is clicked.
this is the code for the ADD button
<a rel="nofollow" class="" id="" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add' mod='advancedcheckout'}"><span><i class="fa fa-plus"></i></span></a>
Changing add=1 is not making any changes. So At start I thought it was a JS or AJAX file, but the button continues working even after I deleted all classes and ID. So I think all this trick is made by the code in href=""
But where I can make the changes for the qty added? Who knows?
If I good understand. You should look at those file:
themes/defaylt-theme/js/product.js: line 424
themes/defaylt-theme/js/product.js: line 408
You have to check the
cart-summary.js
in your theme/js/ folder. This will contain the + and the - button events
function upQuantity
function downQuantity

How to find the text which is outside of a tag using selenium?

I want to retrieve all anchor tags which are labeled as "Working" from the following code.
<div class="A">
Profile 1
Working
<br/>
Profile 2
<br/>
Profile 3
Working
<br/>
</div>
Here I want to retrieve the anchor tags of "facebook" and "linkedin" as they have labeled as "Working".
Following are my trails which didn't work properly.
//div[#class='A']//a//following-sibling::text()
//div[#class='A'][contains(text(),'Working')]
Could any one provide the xpath to achieve this.
Try below expression:
//div[#class='A']/text()[normalize-space()="Working"]/preceding-sibling::a[1]
Which returns
Profile 1
Profile 3

How do i make and attache action to button

Hello I have created a button on my Odoo 10 form "SET geprint" now i want to attach an action to the button. If i press the button the value of the boolean geprint must change to 1. How can I make this possible?
If possible i would also like to create that button in the list view to update multiple records.
Thx for your help
I tried your code but i am getting the following error now
(name field to update is x_geprint)
button code :
You can do it via following methods.
Create object type of button in form view. you can give button type="object", after that when you click on button then system will call python method In which you can write your code.
ex:
<button name="validate" string="Validate" type="object" states="draft" class="oe_highlight"/>
#api.multi
def validate(self):
self.write({})
return True
For the list view you need to create new wizard, In which you can select number of records from list view and in list view Action select your wizard name item.
Ex:
from openerp import models, fields, api, _
class test(models.TransientModel):
_name = 'test.test'
<act_window name="Name String" res_model="wizard.model"
src_model="source.model" view_mode="form" view_type="form"
target="new" multi="False"
id="your_id"
view_id="view_id"
context="{}"/>
In source model Action menu you can select wizard link and In the wizard you will get active_ids in context.
active_ids means all list-view selected records, based on that you can do it any operations with selective records.
This may help you.
Make a server action (settings - > technical - > Server actions)
After that search for the action number in your link please see image (my number is 638)
Then go to the form where you want to add the button. In my example its stock.move
Go into edit formview and add the following code
<button name="638" string=" Set geprint" type="action" />

how to make complete 100% row(device width) inside col-lg-3 using bootstrap

[here i have 2 scenarios, 1) first is image one. there i have 4 cards in a each row(that will change based on screen size 4->2->1). it is in respective classes like col-lg-3 col-md-6 col-sm-6 col-xs-12, i have only one html markup to render the card, many cards are displaying dynamically based on back end data.
2) on clicking button in a each card, their respective extra details will come up in bottom to that in complete row.
here problem is since it is in column class, that extra details occupying only that much space(like parent div), i want that in single row. 1)http://i.stack.imgur.com/d8xEC.jpg 2) http://i.stack.imgur.com/N8ewg.jpg]1
because it's too long, i created a fiddle: https://jsfiddle.net/gxyud676/1/
I'm not too happy with that solution, as it is not responsive.
my first thought was to just use the bootstrap collapsable features to use the cards as collapsible triggers, and place the preview markup outside the rows.
but this approach would open the preview on a xs screen always below the 4th element:
CARD 1
CARD 2 <-- clicking
CARD 3
CARD 4
PREVIEW for 2
CARD 5
CARD 6
...
my fiddle solution was then to detect the screen size (hence the number of used cols) and to move the preview markup to the correct position.
another way could be to duplicate the preview markup on the correct positions (for card 1 there is the preview with class "col-xs-12 visible-xs" just after the card, and the same object with "col-sm-6 col-md-6 visible-sm visible-md" after an evenly positioned card and with "visible-lg" after the current row)
it's more complicated than I initially thought :-/