How to handle purchase order in every sales order in Odoo? - odoo-13

Can Odoo handle purchase orders in every sales order that the items are not yet received by the warehouse?
I have this situation where customer 1 and customer 2 order the same products which are not yet in stocks (on-hand-qty = 0). So Odoo will automatically generate a purchase order to buy the items to the vendor and the company will also purchase enough stocks to compensate for the two customers? Now with 45 days lead time until the products will be receiving in the warehouse.
Example:
Item in warehouse = 0
Customer 1 buy 50 units of an item on the same day but different store.
Customer 2 buy 50 units of the same item on the same day but different store.
The company buys 200 units of the same item Since the lead time for the vendor to deliver the product is 45 days now there is Customer 3 which buys the same product on the same day but different stores but only buys 50.
Now in Odoo, it will generate 4 PO ( 3 for the Customer 1,2,3 and 1 for the company) How to make it 2 3 PO instead of 4? since it will compensate the number of items from the company's order but it will wait for 45 days? then another Customer 4 will buy the same items...etc. It will be a series of RFQ that are not necessary to do automatically.

Related

How do I decrement quantity by line in Excel?

New user on Stack Overflow, apologies for my lack of Excel knowledge.
Essentially I have a spreadsheet with all of our customer orders including order number, item SKU, and quantity sold on that order (see pic for example). To estimate profit margin on each of the lines, I'm trying to assign a vendor cost to the orders for each of the vendors.
For example, if we ordered 150 of SKU ABC1 from Vendor1 and 200 of SKU AB1 from Vendor2, I want to assign the cost of Vendor1 to as many orders of that SKU that equal 150, then finish with cost from Vendor 2 for the rest. This will give us an estimate of how much margin we're making by vendor.
Is each order specific to a Vendor? For example, Order 1 is for Vendor 1, Order 2 is for Vendor 3, etc.
If so, you could add the vendor to each order and then use a VLOOKUP to lookup the cost of the SKU for the given vendor. Then it should just be COST * QTY.
Also new here; otherwise, I would have just left a comment.

How to model more that one product in a classic star schema?

I am building a classic star schema in a data warehouse for reporting.
My measure is Data(MB) per phone number per month.
My dimensions are Time, Product, Customer and Supplier.
My problem is that some customers have bought more than one product per phone number in some month.
Any ideas on how to implement this in a classic star schema?
Adding these columns to my fact table?
PRODUCT_1_FK
PRODUCT_2_FK
PRODUCT_3_FK
Regards,
Christian
Let's imagine this scenario :
Customer with ID =101 bought the product with ID=100 by phone , on
25 Jan 2021
The same Customer with ID=101 bought another product with ID=120 by
phone, on 28 Jan 2021
How would be in your Fact table?
CustomerSK ProductSK SupplierSK TimeSK
101 100 122 25-01-2021 09:00:30
101 120 189 28-01-2021 16:08:11
if your measure is "Data(MB) per phone number per month" then you can't include Product as a dimension as that would alter the grain of your measure.
If you want to the grain of your measure to be "Data(MB) per product per phone number per month" then you'd need to add Product to your fact and you would have 1 fact record per product

How To Figure Out Repeat Purchase Rate With Multiple Variables

I have data in an excel sheet that is essentially a list of all orders for my company over its life span (approximately 14 thousand orders if it matters.) The following fields are relevant for what I'm trying to do currently.
Purchase date (i.e. 6/23/19)
Customer ID (unique ID given to each customer, this ID is constant across all of a customers purchases)
Product category (widgets, woozits, etc.)
Sales person (John Doe, Jane Doe, etc.)
What I'm trying to figure out is our repeat purchase rate by category, and then by sales person.
So ideally I'd like to be able to determine something like
Product category: Widgets
20% of people whose first purchase from us is a widget, purchased something else later on
Of widgets sold by John Doe to first time customers, 15% of the customers purchased something else from us later on
Of widgets sold by Jane Doe to first time customers, 25% of customers purchased something else from us later on.
So basically trying to figure out if different sales reps have better repeat purchase rates on their orders, however we must divide this by product category as our repeat purchase rate by category is going to vary widely (and some sales reps only sell items from certain categories so it would be unfair to compare across categories.)
I believe to do this I need to figure out how to say something like
"Find every widget John Doe sold ; see how many have customer ID's that did not appear on an earlier date ; then see what % of those customer ID's appear at a later date regardless of the next product category or sales person they purchased from."
Hopefully someone can help. I apologize if I didn't explain something particularly well, if there's any confusion I can try my best to clarify.
Thank you!

Restricting purchases on Product overall quantity not on SKU quantity

I want to be able to restrict my orders to a limit on the product quantity and not it's different SKUs.
For instance, say I have a bus route with tickets for each stop. My bus can hold 24 passengers. I want to sell fare on my bus for each of my 24 seats but each stop can be a different price.
I'm having trouble figuring out how to do this in Stripe.
I am thinking I can try and do a metafield with overall quantity in the product and find a way to check against that before accepting an order?

Statistics for people's shoppings

I am building some project (website) on people's shopping (stuff stored in refrigerator) . I need to generate an automatic shopping cart based on people's shopping .
For example if some person buys every week one bottle of milk , than the website will offer the person to buy milk once a week (if there is no milk in refrigerator) .
I am storing shopping history of each family.
But for calculating the shopping cart i need to generate some statistics formula . But i have no clue how to do it. because there might be scenarios (for example birthday) , when the family will buy more products than needed, and it will make me false data for statistics. I want to ignore such scenarios.
Anyone has idea how and what statistics should i use?
pseudocode
assuming the customer had an account and your database is MySQL
every purchase must save customerid, product id/name ,date of purchase,comment(optional) to a table (e.g. purchased table)
customer has their own table that includes at least their personal info(e.g. customer table)
lets say customer browses the product (viewing the website)
• customer clicks the product
• system/server counts the number of purchase in purchase table
• if the number of purchase is more than one then
- get the last date of purchased product - the current date purchased product = frequency of product needed by date
- total number of product purchased / total number of times the product purchased = frequency of product needed by item count
UPDATE
I would suggest that the purchase table has a field that specifies if the current order/purchase is an occasional field instead, so it would be excluded.
example
• system/server counts the number of purchase in purchase table if the purchase is not occasional

Resources