Balance is showing 00.0 when I imported the entries through a sql query in a Journal Entry. oddo10 - sql

What I have done is, I entered Opening Balances in journal Entry through a sql query mentioned below.
insert into account_move_line (move_id,journal_id, company_id, account_id, operating_unit_id, partner_id, name, currency_id, debit, credit, date_maturity) values(18467,79,1,3,10,11091,'TN',21,25538.71,0,'2018-03-31');
Both debit and Credit are showing. Balance being a compute field should reflect automatically but its showing 00.0. Any Idea where I have been wrong in this case?

You have two options:
Import data using the traditional import mechanic, with a .csv file in a module data folder or charging your .csv file directly into screen.
After SQL insert, recomputing in a console the field needed, in this answer you can see how to do that.
I hope this answer can be helful for you.

Related

Adding new product with category tree - specific price problems

I installed an add-on for bulk action (called ba_importer v 1.1.24), I upload an Excel file with my data and create a group of products.
I can set the categories' tree or manually add ID of main categories and associated. I tried with no luck to use the tree features (like Home/Products/etc) and so I use all the ID of main category and all the associated. The result is a product with the correct categories set, but with no specific price from the customer group linked to a category.
I tried to edit a single product, remove all categories and set it one by one (set one, save, set one, save etc.) and then the specific price from the group linked to a category appears to the product.
Is there a better solution? I'm thinking about make a personal PHP page that reads an Excel file and sets all the information about the product, but I'm scared to face the same problem with the specific price. 
There is no such thing as "category-related specific price",
if you have specific prices tied to customer groups , these are created as a result of the add/update product action with ps_specific_price DB entries having id_group with your restricted ID.
It is likely that the bulk module acts directly with DB queries to speed up things and bypasses this operation, I've seen this behaviour with those kind of modules in the past.
Since you are talking of a paid add-on, I would definitely seek help from the developer.

Cannot create a PARTITION BY DATE(timestamp)

Hello I am using my personal GCP account to play around in Bigquery, and I am still within my free-tier range (a billing account is linked, but no fees incurred yet).
So I create a table to fetch baseball.games_wide table from bigquery-public-dataset. The following is my simple CREATE TABLE query with PARTITION on a timestamp column 'startTime'.
CREATE TABLE project.table
PARTITION BY date(startTime) AS
SELECT
gameId, seasonID, date(startTime) as game_date, startTime, year
FROM `bigquery-public-data.baseball.games_wide`
WHERE YEAR = 2016
The table was created successfully and I can see the worker has the write phase, which is an indicator that something is writing to the table. However, when I go to 'Preview' the table, there is no data to display, and table size is 0 KB.
I tried remove the second line (i.e., PARTITION BY date(startTime)) when creating table, the data can be ingested and I am able to Preview it in console. It seems the PARTITION command is causing problem, but I can't tell where goes wrong. Any idea?
As you have mentioned in the comment this issue is resolved by creating a new dataset after the billing account is linked to the project.
You can follow this tutorial to create billing account and link it to project.

Odoo - Bulk Update Product Variant Internal ID

I am working with odoo community edition 11 and have been looking for the correct way to bulk import internal reference numbers for product variants.
I have attempted to export the data in a usable format however each time I am able to get the necessary fields, the product variants are duplicated in the export. In the image below you can see that each product in this case is shown twice.
With approximately 1800 variant products currently, this issue isn't something that's a simple workaround. And this number is expected to increase dramatically over the next few weeks.
I'm looking for guidance on how to get the initial export of all product variants with no assigned internal reference to function properly.
The fields I need to be able to bring down is the product ID (reference for import) the internal reference (or blank) and the variant attributes assigned to that particular product variant.
Any assistance in pushing me in the right direction would be greatly appreciated.
** Output from first answer below:
Go to Inventory > Master data > Product variants, select a product and got to action>export, select radio button Export all Data. Select columns 'Display name, Internal Reference, ID', then choose save export and save the export with any name. Now cancel the export, select all product variants, go to export again and this time keep 'Import compatible' selected, choose that saved export from earlier.
You will have exported list of product variants with column Full name which contains 'variant attributes' in it. and you can import this modifying the Internal reference column.
For example, check this from a new demo database in odoo:

SQL query to change text on export, but not in database

I was wondering if there is a way to write an SQL query that would change text upon export but not in the database.
For example:
I have a query that exports a .csv file with prices and quantities for selling products online. Then I manually change a few products prices to cover online fees and then upload the file. What I would like to accomplish is having this built into the query so I can have it update automatically but I do not want the price to be changed in my database.
Is this possible?
Thanks, and let me know if you'd like additional clarification.
You can manually modify the select without affecting the data in the database. For example, if ordering shoes adds a 15% online fee, you could do the following:
SELECT
CASE WHEN [ProductType] = 'Shoes' THEN Price * 1.15 ELSE Price END AS OnlinePrice
FROM
[dbo].[Product]
If that doesn't help, can you provide a more concrete example of what you're trying to achieve?

How to update stock quantity

VB.NET
Well, I'm using Access as DB containing five tables viz. Vendors, PurOrder, Customers, SalesOrder, Stock.
Vendors: VendorID(PK), Name, Contact, Phone, Address.
PurOrder: POID(PK), Items, Quantity, Rate, Total
Customers: CustID(PK), Name, Phone, Address
SalesOrder: SOID(PK), Items, Quantity, Rate, Total
Stock: SItemID(PK), Items, Quantity, Rate, Total
I'm using the Database Wizard in VB.NET Express. I do not need to code for that. I click on Data Sourses > add the Database > Drag that to my Purchase and Sales form and that automaticaly creates the ADD, DELETE, & SAVE as well as Navigation buttons as toolstrip. and furthermore I drag the Purchase order table (for example) to the form in Datagrid mode and that's it! Now, I can SAVE, DELETE, & ADD records to my database as Purchases.
Well I am able to enter and save/update purchase and sales vouchers and retrieve the reports Customer/Vendor ID-wise and print that.
The only problem I have is that I don't know what to do in order to automatically update the sock quantity when purchase or sale is made.
Thanks in advance.
In many other mainstream database software, they support Trigger, which achieves your goal (automatic update the purchase count). Consider using other database software, as MS Access's performance is not so good.
To answer your question, you have to do an extra query to update the value.