Skip to content
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

Open
wants to merge 5 commits into
base: 16.0
Choose a base branch
from
Open

ADD account_stock_situation #308

wants to merge 5 commits into from

Conversation

bealdav
Copy link
Member

@bealdav bealdav commented Jul 11, 2024

No description provided.

Copy link
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 <[email protected]>
Copy link
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
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
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
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
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
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
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
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
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
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