How to exclude value from google merchant file if it's "0" - google-merchant-center

i want to exclude one of the fields (sale_price) from usage if it's value in merchant file is '0' but Google merchant file rules are so confusing idk where to and how to do that because every time i want to use sale price in rule i can't just find something like "if sale_price is '0' do no use that field" or "set to "null"

Related

How to call bank informations when there are more than one bank account

I'm working with Odoo 14 eCommerce module for shop and I'm customising email template (Sales: Order Confirmation).
I would like to show bank information which are already inserted on Accounting / Bank Accounts section of the company contact information such as; bank name, account holder name, account number etc.
I'm calling those values like this in the template:
${object.company_id.bank_ids.acc_holder_name}
${object.company_id.bank_ids.bank_name}
${object.company_id.bank_ids.acc_number}
When there is only one bank account defined, I get the right values without problem, but as soon as I add a second bank account, I get this error below:
Failed to render template : Expected singleton: res.partner.bank(2, 3)
I understand that there are ids of bank accounts, but I don't know what is the right way to indicate the id of the bank account which I want to get the value. Any idea?
You should loop over the bank records in the email template, this way:
% for bank in object.company_id.bank_ids:
<li>${bank.acc_holder_name}</li>
<li>${bank.bank_name}</li>
<li>${bank.acc_number}</li>
% endfor
If you want to do some action inside the loop depending on the ID of the bank account you should do this:
% for bank in object.company_id.bank_ids:
% if bank.id == 2:
<li>${bank.acc_holder_name}</li>
<li>${bank.bank_name}</li>
<li>${bank.acc_number}</li>
% endif
% endfor
However, performing an action depending on the database ID is not recommended since your module may won't work in any database. You must value yourself if it's worth it in this particular case.

Odoo - Can't Change Default Currency Company

I want to change the company currency by opening Setting->Companies->Currency. But when I already change the currency and hit save button, I get this warning dialog
You cannot change the currency of the company since some journal items already exist
How to solve this problem?
You cannot change the currency of the company since some journal items already exist
Some data are already created with the same currency, if you do not need that entry then simply delete it and then change the currency.
reference code - Source Code
#forbid the change of currency_id if there are already some accounting entries existing
if 'currency_id' in values and values['currency_id'] != company.currency_id.id:
if self.env['account.move.line'].search([('company_id', '=', company.id)]):
raise UserError(_('You cannot change the currency of the company since some journal items already exist'))
The error occurs because there was journal entries exist. You have at least 2 options if you must change the company currency:
Delete all journal entries.
Update all currency ID in all journal entries with new currency id directly via PostgreSQL.
Once option 1 or 2 done, then try again to change the company currency.

WooCommerce: How to automatically select variation attribute dropdown field when there is only 1 option?

So I feel like this isn't too complicated of a request, but I simply can't figure it out. On my WooCommerce site, I have some variable products. There are 3 dropdown variation attributes in the following order (top to bottom): Color, Type, and Part Number. Each variation has a unique part number (only 1 part number per combination), so there is literally no need for the user to select the part number after they have chosen color & type. However, I need that part number to display for purposes of my product feed and so the customer can see the part number they have chosen by the previous 2 options.
My question is; since selecting a "Color" and "Type" narrows the final field ("Part number") down to only 1 option, how do I instruct WooCommerce to automatically select the single "part number" option that's available?
You can do this with JS:
jQuery('a.toggle_component').click(function(e){
if(!(jQuery(e.target).parents('.component').find('select.component_options_select > option[selected=selected]').val())) {
jQuery(e.target).parents('.component').find('select.component_options_select > option:nth-child(2)').attr('selected','selected');
jQuery(e.target).parents('.component').find('select.component_options_select').change();
}
});

Printing watson entity found in text (input)

I have a situation, where user asks for "I want to buy us dolars". I have already defined the intent for the question "I want to buy". What I need, is to identify which currency user is talking about (buying).
For that, I created an Entity "money", with a value "currency", and its synonyms (us dollar, euros, ienes, ....).
The issue is, that the node recognizes #items:buying and #money:currency. How can I get which currency was found, and use it onto the context/output?
I tried using and also
but it always returns an empty value.
entities[0] returns me only the buying stuff, the first recognized thing. I need the second, specifically by name, in order to customize my conversation flow.
Thanks a lot.
To resolve this, first switch on #sys-currency system entity.
After that, this example should work once training is complete.
Condition: #sys-currency
Response: Currency: <? #sys-currency.unit ?>. Total: <? #sys-currency ?>
However it assumes that you are writing the currency correctly. For example:
20 USD
$20
20 dollars
More details here:
https://www.ibm.com/watson/developercloud/doc/conversation/system-entities.html#sys-currency-entity
To address the other point of finding the value of the recognised text of the entity, you would use:
<? entities[0].literal ?>

Prestashop Tax Off When VAT Number Inserted

In my shop, when a user inserts a VAT number, the tax value desapears. I understand its comon practice abroad. But here in Portugal, the tax value is allways present.
I tried with Vat module and normal "NIF" field, but neither appears with tax value, or in the final invoice.
Im running, prestashop 1.6.0.8.
Someone with the same problem as me, another portuguese, says it got it workgin doing the folloying instrutions from a spanish tutorial:
In controllers/AuthController.php
Change
If ($country->need_identification_number && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
To
//if ($country->need_identification_number && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
if (!Validate::isDniLite(Tools::getValue(‘dni’)))
And in “controllers/”AddressController.php,
Change
if ($country->isNeedDni() && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
To
//if ($country->isNeedDni() && (!Tools::getValue(‘dni’) || !Validate::isDniLite(Tools::getValue(‘dni’))))
if (!Validate::isDniLite(Tools::getValue(‘dni’)))
But this code is for 1.5.x presta and mine is 1.6.0.8 and i guess dni is ther tax name.
Heres the source: http://postly.elnostreraco.com/como-hacer-el-dni-opcional-en-prestashop-y-por-que-desconfiar-si-te-hacen-tocar-codigo-base/
When using the VAT Module you can select a country. For users from that country (the one you selected in the module config), VAT will be added. For users from other countries, VAT will not be calculated, which, i believe, is in accordance with EU Law.
From here:
Your PrestaShop is misconfigured. When no "Your country" set in module "vatnumber" and your customer fill in the vat_number field, presta shop will force tax-free price.
I've selected country in this module (but not vat number validation) and it worked - user enter vat code or not, VAT is applied.