erp5_ingestion: Use script and type based method to add or not published state

The initial idea was that publishing documents is something really exceptional, the "attach document" normal use case is typically use cases like attaching a PDF invoice to an invoice document in accounting, ie. most of the time it's with sensitive information that we don't want users to be mistakenly publish on the internet just because they selected a wrong value in the field.

Now we have a project with use cases where the attached documents needs to be published, we did not change our mind that publishing an attached document is an exceptional case, but we want to make it possible to configure so that in certain contexts, publishing documents is possible.

So we reuse the existing configuration by type based method idea and when the getPreferredAttachedDocumentPublicationState returns "published" we make it possible to publish by default.
11 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Master

00:48:53

failed ERP5.PerformanceTest-Master

00:26:12

failed ERP5.UnitTest-Master

01:16:07

failed ERP5.UnitTest-Master.Medusa

01:21:51

passed SlapOS.Eggs.UnitTest-Master.Python2

00:20:40

passed SlapOS.Eggs.UnitTest-Master.Python3

00:12:09

failed ERP5.UnitTest-Master

01:22:30

passed SlapOS.Eggs.UnitTest-Master.Python2

00:11:49

passed SlapOS.Eggs.UnitTest-Master.Python2

00:11:50

passed SlapOS.Eggs.UnitTest-Master.Python3

00:13:47

passed SlapOS.Eggs.UnitTest-Master.Python3

00:14:34