-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD account_stock_situation #308
base: 16.0
Are you sure you want to change the base?
Conversation
6b4adfd
to
b979984
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -0,0 +1,2 @@ | |||
* Akretion | |||
* David BEAL <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faut te rajouter ici
class StockQuant(models.Model): | ||
_inherit = "stock.quant" | ||
|
||
warehouse_id = fields.Many2one(store=True, index=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il me semble cela peut etre pénalisant au niveau perf de storer ce champ !?
|
||
def _set_account_stock_valuation(self, company_string_id): | ||
self = self.env.ref(company_string_id) | ||
value, attach = self._get_stock_valuation_another() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value, attach = self._get_stock_valuation_another() | |
value, attach = self._get_stock_valuation() |
) | ||
attach.res_id = move.id | ||
|
||
def _get_stock_valuation_another(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _get_stock_valuation_another(self): | |
def _get_stock_valuation(self): |
warehouse_id = warehouse_quantities[i] | ||
quantity = warehouse_quantities[i + 1] | ||
warehouse_id = self.env["stock.warehouse"].browse(warehouse_id) | ||
vals[f"qté_{warehouse_id.name}"].append(round(quantity)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vals[f"qté_{warehouse_id.name}"].append(round(quantity)) | |
vals[f"qty_{warehouse_id.code}"].append(round(quantity)) |
|
||
# TODO quand la valeur est < cost_vs_purchase_threshold % de ce seuil | ||
# mettre une colonne 'check' à la valeur 1 | ||
vals["valeur"].append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vals["valeur"].append( | |
vals["value"].append( |
<odoo noupdate="1"> | ||
|
||
<record id="stock_account_valuation_main_company" model="ir.cron"> | ||
<field name="name">Stock Valorisation</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="name">Stock Valorisation</field> | |
<field name="name">Stock Situation</field> |
["product_id", "warehouse_id", "quantity"], | ||
["product_id", "warehouse_id"], | ||
lazy=False, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du coup je ne pense pas kil faut utiliser le read_group vu que c pas top de stocker le warehouse ds les locations.
Tu pourrais modifier la PR en ce sens ?
# mettre une colonne 'check' à la valeur 1 | ||
vals["valeur"].append( | ||
round( | ||
max( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max( | |
product.standard_price |
prices[product] and prices[product].price or 0 * coef / 100, | ||
) | ||
* product["quantity"] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ne pas mettre les lignes dessus de 136 à ici , je reverrai plus tard.
8210887
to
f46bf86
Compare
71a6485
to
aa0da11
Compare
No description provided.