Skip to content

ADD account_stock_situation#308

Open
bealdav wants to merge 5 commits into16.0from
stock-valuation
Open

ADD account_stock_situation#308
bealdav wants to merge 5 commits into16.0from
stock-valuation

Conversation

@bealdav
Copy link
Copy Markdown
Member

@bealdav bealdav commented Jul 11, 2024

No description provided.

Copy link
Copy Markdown
Member Author

@bealdav bealdav left a 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 <david.beal@akretion.com>
Copy link
Copy Markdown
Member Author

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)
Copy link
Copy Markdown
Member Author

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()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value, attach = self._get_stock_valuation_another()
value, attach = self._get_stock_valuation()

)
attach.res_id = move.id

def _get_stock_valuation_another(self):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="name">Stock Valorisation</field>
<field name="name">Stock Situation</field>

["product_id", "warehouse_id", "quantity"],
["product_id", "warehouse_id"],
lazy=False,
)
Copy link
Copy Markdown
Member Author

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(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
max(
product.standard_price

prices[product] and prices[product].price or 0 * coef / 100,
)
* product["quantity"]
)
Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants