Пример #1
0
 def buildSalesRelationFields(self):
     # ==================================================================== #
     # Sale Person Name
     if "user_id" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "user_id",
                             "Salesperson Name")
         FieldFactory.microData("http://schema.org/Author", "name")
         FieldFactory.addChoices(M2OHelper.get_name_values("res.users"))
         FieldFactory.group("General")
     # ==================================================================== #
     # Sale Person Email
     if "user_id" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "user_email",
                             "Salesperson Email")
         FieldFactory.microData("http://schema.org/Author", "email")
         FieldFactory.group("General")
         FieldFactory.isNotTested()
     # ==================================================================== #
     # Sale Team Name
     if "team_id" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "team_id",
                             "Sales team Name")
         FieldFactory.microData("http://schema.org/Author", "memberOf")
         FieldFactory.addChoices(M2OHelper.get_name_values("crm.team"))
         FieldFactory.group("General")
         FieldFactory.isNotTested()
Пример #2
0
    def get_name_values(type_tax_use='sale'):
        """
        Get a Relation Possible Values Dict

        :param type_tax_use: str
        :rtype: dict
        """
        from odoo.addons.splashsync.helpers import M2OHelper\

        return M2OHelper.get_name_values(TaxHelper.tax_domain,
                                         [("type_tax_use", "=", type_tax_use)])
Пример #3
0
 def buildSupplierFields(self):
     # ==================================================================== #
     # Safety Check
     if "seller_ids" not in self.getModel().fields_get():
         return
     # ====================================================================#
     # First Supplier Name
     FieldFactory.create(const.__SPL_T_VARCHAR__, "supplier_name",
                         "Supplier Name")
     FieldFactory.microData("http://schema.org/Product", "supplierName")
     FieldFactory.addChoices(
         M2OHelper.get_name_values(SupplierHelper.vendorDomain,
                                   SupplierHelper.filter))
     FieldFactory.isNotTested()
     # ====================================================================#
     # First Supplier Price as Double
     FieldFactory.create(const.__SPL_T_DOUBLE__, "supplier_price_dbl",
                         "Supplier Price (Float)")
     FieldFactory.microData("http://schema.org/Product", "supplierPriceDbl")
     FieldFactory.association("supplier_name")
     # ==================================================================== #
     # First Supplier Price
     FieldFactory.create(const.__SPL_T_PRICE__, "supplier_price",
                         "Supplier Price")
     FieldFactory.microData("http://schema.org/Product", "supplierPrice")
     FieldFactory.isWriteOnly(Framework.isDebugMode())
     FieldFactory.isNotTested()
     # ====================================================================#
     # First Supplier SKU
     FieldFactory.create(const.__SPL_T_VARCHAR__, "supplier_sku",
                         "Supplier SKU")
     FieldFactory.microData("http://schema.org/Product", "mpn")
     FieldFactory.association("supplier_name", "supplier_price_dbl")
     # ====================================================================#
     # First Supplier MOQ
     FieldFactory.create(const.__SPL_T_INT__, "supplier_min_qty",
                         "Supplier MOQ")
     FieldFactory.microData("http://schema.org/Product", "supplierMinQty")
     FieldFactory.association("supplier_name", "supplier_price_dbl")
     # ====================================================================#
     # First Supplier Currency
     FieldFactory.create(const.__SPL_T_CURRENCY__, "supplier_currency",
                         "Supplier Currency")
     FieldFactory.microData("http://schema.org/Product", "supplierCurrency")
     FieldFactory.isNotTested()
Пример #4
0
 def buildCarrierFields(self):
     if "carrier_id" not in self.getModel().fields_get():
         return
     # ====================================================================#
     # Delivery Carrier Name
     FieldFactory.create(const.__SPL_T_VARCHAR__, "carrier_id",
                         "Carrier Name")
     FieldFactory.microData("http://schema.org/ParcelDelivery",
                            "identifier")
     FieldFactory.addChoices(M2OHelper.get_name_values("delivery.carrier"))
     FieldFactory.group("General")
     # ====================================================================#
     # Delivery Carrier Description
     FieldFactory.create(const.__SPL_T_VARCHAR__, "carrier_desc",
                         "Carrier Description")
     FieldFactory.microData("http://schema.org/ParcelDelivery", "provider")
     FieldFactory.group("General")
     FieldFactory.isReadOnly()
Пример #5
0
 def buildRelationFields(self):
     # ==================================================================== #
     # Product Main category
     FieldFactory.create(const.__SPL_T_VARCHAR__, "categ_id",
                         "Categorie Id")
     FieldFactory.microData("http://schema.org/Product", "classificationId")
     FieldFactory.isReadOnly()
     FieldFactory.create(const.__SPL_T_VARCHAR__, "categ", "Categorie")
     FieldFactory.microData("http://schema.org/Product", "classification")
     FieldFactory.addChoices(M2OHelper.get_name_values("product.category"))
     FieldFactory.isNotTested()
     # ==================================================================== #
     # Product Routes
     FieldFactory.create(const.__SPL_T_VARCHAR__, "route_ids", "Routes Ids")
     FieldFactory.microData("http://schema.org/Product", "routesId")
     FieldFactory.isReadOnly()
     FieldFactory.create(const.__SPL_T_VARCHAR__, "routes", "Routes")
     FieldFactory.microData("http://schema.org/Product", "routes")
     FieldFactory.isNotTested()
     # ==================================================================== #
     # Website category
     if "public_categ_ids" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "public_categ_ids",
                             "Categorie Id")
         FieldFactory.microData("http://schema.org/Product",
                                "publicCategoryId")
         FieldFactory.isReadOnly()
         FieldFactory.create(const.__SPL_T_INLINE__, "public_categ",
                             "Public Categorie")
         FieldFactory.microData("http://schema.org/Product",
                                "publicCategory")
         FieldFactory.addChoices(
             M2OHelper.get_name_values("product.public.category"))
         FieldFactory.isNotTested()
     # ==================================================================== #
     # Website Alternate Products
     if "alternative_product_ids" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__,
                             "alternative_products",
                             "Alternate Products Names")
         FieldFactory.microData("http://schema.org/Product",
                                "alternateModels")
         FieldFactory.isNotTested()
     # ==================================================================== #
     # Website Accessory Products
     if "accessory_product_ids" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "accessory_products",
                             "Accessory Products Names")
         FieldFactory.microData("http://schema.org/Product",
                                "crossellModels")
         FieldFactory.isNotTested()
     # ==================================================================== #
     # Allowed Companies
     if "ons_allowed_company_ids" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "company_ids",
                             "Companies IDs")
         FieldFactory.microData("http://schema.org/Product",
                                "allowedCompanies")
         FieldFactory.isNotTested()
         FieldFactory.create(const.__SPL_T_VARCHAR__, "company_names",
                             "Companies Names")
         FieldFactory.microData("http://schema.org/Product",
                                "allowedCompaniesNames")
         FieldFactory.isNotTested()
     # ==================================================================== #
     # Product Brand
     if "product_brand_id" in self.getModel().fields_get():
         FieldFactory.create(const.__SPL_T_VARCHAR__, "product_brand_id",
                             "Brand Id")
         FieldFactory.microData("http://schema.org/Product", "brandId")
         FieldFactory.isReadOnly()
         FieldFactory.create(const.__SPL_T_VARCHAR__, "product_brand",
                             "Brand")
         FieldFactory.microData("http://schema.org/Product", "brand")
         FieldFactory.addChoices(M2OHelper.get_name_values("product.brand"))
         FieldFactory.isNotTested()