Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bealdav committed Jul 16, 2024
1 parent 6f0e597 commit 2bd888f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
23 changes: 8 additions & 15 deletions account_stock_situation/models/config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,18 @@ def __default_account_purchase_stock_domain(self):
comodel_name="account.account",
readonly=False,
related="company_id.account_purchase_stock_id",
domain=[("code", "ilike", lambda s: s.account_purchase_stock_domain)],
)
account_stock_id = fields.Many2one(
comodel_name="account.account",
readonly=False,
related="company_id.account_stock_id",
domain=[("code", "ilike", lambda s: s.account_stock_domain)],
)
account_stock_domain = fields.Char(default=__default_account_stock_domain)
account_purchase_stock_domain = fields.Char(
default=__default_account_purchase_stock_domain
)
account_stock_help = fields.Text(compute="_compute_account_stock_help")

def _account_stock_domain(self, kind=None):
"Other localisations maybe completed here"
if "l10n_fr" in self.env.registry:
if not kind:
return "355%00"
elif kind == "purchase":
return "603%"
else:
return "%"
def _compute_account_stock_help(self, kind=None):
for rec in self:
name = ""
if "l10n_fr" in self.env.registry._init_modules:
name = "Compte de stock: '355...'"
name += "Compte de stock d'achat: '603...'"
rec.account_stock_help = name
23 changes: 12 additions & 11 deletions account_stock_situation/views/config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="priority" eval="200" />
<field name="inherit_id" ref="misc_settings.res_config_settings_view_form" />
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='invoicing_settings']" position="afer">
<h2>Valorisation de Stock Valuation</h2>
<xpath expr="//div[@id='invoicing_settings']" position="after">
<h2>Stock Valuation</h2>
<div class="row mt16 o_settings_container" name="stock_valuation">
<div class="col-12 col-lg-6 o_setting_box" id="valued_wh">
<div class="o_setting_right_pane">
Expand Down Expand Up @@ -46,12 +45,17 @@
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="account_stock_help">
<div class="o_setting_right_pane">
<span class="o_form_label">Aide</span>
<div class="row mt8">
<field name="account_stock_help" />
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="account_stock">
<div class="o_setting_right_pane">
<span class="o_form_label">Stock account</span>
<div class="text-muted">
Stock account
</div>
<div class="row mt8">
<field name="account_stock_id" />
</div>
Expand All @@ -60,11 +64,8 @@
<div class="col-12 col-lg-6 o_setting_box" id="account_purchase_stock">
<div class="o_setting_right_pane">
<span class="o_form_label">Purchase stock account</span>
<div class="text-muted">
Stock account
</div>
<div class="row mt8">
<field name="account_purchase_stock_id" />
<field name="account_purchasestock_id" />
</div>
</div>
</div>
Expand Down

0 comments on commit 2bd888f

Please sign in to comment.