Skip to content
Extraits de code Groupes Projets
Valider 2327a9ed rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[FIX] displays making doc

parent 5d8e7102
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -154,7 +154,6 @@ class SaleIntervention(models.Model):
related="mulch2_id.uom_id",
readonly=True,
string="Unité de mesure paillage 2",
states={"draft": [("readonly", False)], "sent": [("readonly", False)]},
)
mulch2_has_staples = fields.Boolean(
string="Paillage 2 avec agrafes",
......@@ -194,7 +193,7 @@ class SaleIntervention(models.Model):
readonly=True,
states={"draft": [("readonly", False)], "sent": [("readonly", False)]},
)
stake_qty = fields.Float(
stake_qty = fields.Integer(
string="Qté Piquets",
readonly=True,
states={"draft": [("readonly", False)], "sent": [("readonly", False)]},
......@@ -522,7 +521,7 @@ class SaleIntervention(models.Model):
self.collarette_qty = (
math.ceil(self.intervention_length / self.plant_interval) + 1
)
elif self.intervention_uom_name == "Unité":
elif self.intervention_uom_name == "Unité(s)":
self.collarette_qty = self.plant_qty
else:
self.collarette_qty = 0
......@@ -961,7 +960,10 @@ class SaleIntervention(models.Model):
data.update(
{
"order_id": self.sale_order_id.id,
"name": self.project_id.name + " - " + product_tmpl.name,
"name": "Projet "
+ self.project_id.name
+ " - "
+ product_tmpl.name,
"product_id": product_tmpl.product_variant_id.id,
"sale_project_id": self.project_id.id,
}
......@@ -1004,7 +1006,6 @@ class SaleInterventionStock(models.Model):
price_unit = fields.Float(
"Prix Unitaire", required=True, digits="Product Price", default=0.0
)
taxes_id = fields.Many2many(related="product_template_id.taxes_id")
price_total = fields.Float(
compute="_compute_amount",
string="Total",
......
......@@ -159,11 +159,7 @@ class SaleProject(models.Model):
rec.geo_sector_id = rec.sale_order_id.partner_id.geo_sector_id.id
seq = str(rec.sale_order_id.partner_id.sale_project_count).zfill(3)
rec.name = (
rec.sale_order_id.partner_id.ref
+ "-"
+ datetime.now().strftime("%y")
+ "-"
+ seq
rec.sale_order_id.partner_id.ref + "-" + rec.saison_id.name + "-" + seq
)
def unlink(self):
......@@ -216,7 +212,7 @@ class SaleFinancialHelp(models.Model):
_name = "sale.financial.help"
_description = "Aide financière"
name = fields.Char("Aide financière")
name = fields.Char("Aide financière", required=True)
class SaleProjectSuivi(models.Model):
......
......@@ -11,9 +11,11 @@ class ProjectSubvention(models.Model):
# ------------------------------------------------------
# Fields declaration
# ------------------------------------------------------
name = fields.Char("Nom de la subvention")
name = fields.Char("Nom de la subvention", required=True)
type = fields.Selection(
[("forfait", "Tarif unique"), ("grid", "Grille")], "Type de subvention"
[("forfait", "Tarif unique"), ("grid", "Grille")],
"Type de subvention",
required=True,
)
product_pricelist_ids = fields.One2many(
comodel_name="product.pricelist",
......
......@@ -291,7 +291,7 @@
<field name="model">sale.intervention</field>
<field name="arch" type="xml">
<tree string="Interventions" expand="True">
<field name="name" optional="show" />
<field name="name" optional="show" readonly="True" />
<field name="state" invisible="1" />
<field name="sale_order_id" optional="hide" />
<field name="project_id" optional="hide" />
......@@ -378,7 +378,9 @@
<field name="res_model">sale.intervention</field>
<field name="view_mode">tree,form,pivot,graph</field>
<field name="search_view_id" ref="sale_intervention_search" />
<field name="context">{'search_default_group_by_order': True}</field>
<field
name="context"
>{"search_default_group_by_order": True, "create": False}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
Aucune intervention trouvée. Créez un nouveau projet depuis un devis
......
......@@ -24,7 +24,7 @@
string="Projets"
>
<tree editable="bottom">
<field name="name" optional="show" />
<field name="name" optional="show" readonly="True" />
<field name="state" invisible="1" />
<field name="project_subvention_id" optional="show" />
<field name="user_id" optional="show" />
......@@ -55,7 +55,12 @@
expr="//field[@name='order_line']/tree/field[@name='product_id']"
position="before"
>
<field name="sale_project_id" optional="show" string="Projet" />
<field
name="sale_project_id"
optional="show"
string="Projet"
readonly="True"
/>
</xpath>
<page name="order_lines" position="after">
......
......@@ -67,7 +67,11 @@
context="{'search_default_group_by_intervention_type': True}"
>
<tree default_order="intervention_type_id,name">
<field name="name" optional="show" />
<field
name="name"
optional="show"
readonly="True"
/>
<field name="state" invisible="1" />
<field
name="intervention_type_id"
......@@ -102,7 +106,7 @@
<field name="model">sale.project</field>
<field name="arch" type="xml">
<tree string="Projet de Création" create="false">
<field name="name" optional="show" />
<field name="name" optional="show" readonly="True" />
<field name="sale_order_id" optional="show" />
<field name="state" invisible="1" />
<field name="project_subvention_id" optional="show" />
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter