From 6ba031c8e2316cca799af1e73ff6bba3192ad8dd Mon Sep 17 00:00:00 2001
From: Juliana <juliana@le-filament.com>
Date: Thu, 29 Apr 2021 15:25:44 +0200
Subject: [PATCH] [ADD] Ajout second vendeur

---
 __init__.py             |  4 +++-
 __manifest__.py         |  1 +
 models/__init__.py      |  4 ++++
 models/account.py       | 45 +++++++++++++++++++++++++++++++++++++++++
 views/account_views.xml | 17 ++++++++++++++++
 5 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 models/__init__.py
 create mode 100644 models/account.py
 create mode 100644 views/account_views.xml

diff --git a/__init__.py b/__init__.py
index f86d099..957992f 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,2 +1,4 @@
-# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+# Copyright 2021 Le Filament (<http://www.le-filament.com>)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
 
+from . import models
diff --git a/__manifest__.py b/__manifest__.py
index 1c82eb0..ebf5bc9 100644
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -12,5 +12,6 @@
     "data": [
         "views/account_bank_statement.xml",
         "views/account_move_line.xml",
+        "views/account_views.xml",
     ]
 }
diff --git a/models/__init__.py b/models/__init__.py
new file mode 100644
index 0000000..783ab68
--- /dev/null
+++ b/models/__init__.py
@@ -0,0 +1,4 @@
+# Copyright 2021 Le Filament (<http://www.le-filament.com>)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import account
diff --git a/models/account.py b/models/account.py
new file mode 100644
index 0000000..2973dc4
--- /dev/null
+++ b/models/account.py
@@ -0,0 +1,45 @@
+# Copyright 2021 Le Filament (<http://www.le-filament.com>)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import fields, models, api
+
+
+class AccountInvoice(models.Model):
+    _inherit = "account.invoice"
+
+    # ------------------------------------------------------
+    # Fields declaration
+    # ------------------------------------------------------
+    user_second_id = fields.Many2one(
+        'res.users',
+        string='Vendeur Bis',
+        track_visibility='onchange',
+        default=lambda self: self.env.user, copy=False)
+
+    # ------------------------------------------------------
+    # SQL Constraints
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # Default methods
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # Computed fields / Search Fields
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # Onchange / Constraints
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # CRUD methods (ORM overrides)
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # Actions
+    # ------------------------------------------------------
+
+    # ------------------------------------------------------
+    # Business methods
+    # ------------------------------------------------------
diff --git a/views/account_views.xml b/views/account_views.xml
new file mode 100644
index 0000000..7cb6054
--- /dev/null
+++ b/views/account_views.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+    <data>
+        
+        <record id="invoice_form" model="ir.ui.view">
+            <field name="name">account.3a.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+                <field name="user_id" position="after">
+                    <field name="user_second_id"/>
+                </field>
+            </field>
+        </record>
+    
+    </data>
+</odoo>
\ No newline at end of file
-- 
GitLab